I’m new to flash, but I have drag and drop code for my movieclips and so can manipulate them in this way. But I would like to be able to display an image depending on where the user clicks on the movie scene. What would the code be that loads an image, onClick, at the mouse X and Y? Thanks
Share
I’m mainly a Flex developer but this code snippet of AS3 should work fine for you in Flash as well:
The documentation for AS3 is pretty thorough and can be found here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/index.html
they did a good job with this version of the documentation of giving you filters at the top of the page to see only items available in Flash only or using a Flex framework or using AIR. A quick breakdown of how all this relates: AS3 is the scripting language used to write code that gets compiled into what’s known as AS3 bytecode (typically all in a file with a swf or swc extension) which is then interpreted by the Flash plugin in the browser. MXML is a “declarative markup language” it’s very similar in appearance to HTML using tags and nesting to represent relationships of parent/child (they are both loosely XML), the MXML gets compiled to AS3 then to AS3 bytecode and once again interpreted by the flash plugin. Nice thing about Flex is there’s a whole lot of pre-built components provided and the framework creates a robust set of rules for how you can create extensible components with a well defined life cycle (you know it gets created once, you know only to update the parts that require updating ie createChildren, commitProperties, measure etc.). AIR is adobe integrated run-time which is basically a flash player for the desktop where it can live outside the browser and is therefore not limited to the functionality allowed by the browser (due to security issues lots of operations are blocked by the browser), basically AIR is Flex+Desktop related goodies. I know this is more than what your asking for but I hope you find this info useful.
Good luck,
Shaun