For example, you have a series of buttons in your Flash movie with instance names “button1”, “button2”, etc. and you each to do something different to your HTML when clicked.
This function will be called by all of our buttons, and will bring up a popup with the name of the button that was clicked.
Step 2: the Actionscript
Now, in your flash file, the first thing to do is import the proper packages. At the top of your Actionscript, add the line:
button2. addEventListener(MouseEvent.CLICK, onClick);
Then define your “onClick” function:
Step 3: Embedding your flash
If you’re using SWFObject version 1.5, your code will looks something like this:
If you’re using SWFObject 2.0, just add the line:
<param name="allowscriptaccess" value="sameDomain" />
inside the <object> tag, or you can use their script generator to set the “allowScriptAccess” parameter. You will find it under “more” under SWF Definition. The whole SWFObject version 2.0 code will looks something like this:
More by this Author
The U-Haul U-Box program has changed significantly since I first used them back in the spring of 2009, and so my original review is sorely in need of an update.
While content may be king in a successful website, usability has to be queen. You may have the best content out there with a gorgeous design and a page ranking to envy, but if your visitors can’t navigate...
Edit: U-Box has changed a lot since I wrote this article. For my more recent experiences with U-Box, please see U-Box Review Part 2. Edit: For those of you interested in sending your U-Box to Canada, check out Moving...