|
-
How to use functions to disable and re-enable container SWF's control?
I supplied a flash ad to a digital publication, the magazine ones where the pages flip. My ad has different pages you can view when you hover over the top tabs. On each of these pages are words or buttons that you can click on to direct you to a URL. I used the simple code (Actionscript 1.0, Macromedia Flash MX) below to achieve this:
PHP Code:
on(release){
getURL("www.link.com","_blank");
}
This works fine, but when the files were uploaded into the digital publication, they have a zoom feature that basically disables my code.
Below are the instructions they gave me to make it work, but I have no idea how to use this. I have searched for this all over and don't understand. Any help if appreciated!
Any user-interactive elements (e.g., buttons) must use the following two functions to disable and then re-enable the container SWF’s control over interactions:
1) _root.overButton(); //to deactivate the container SWF’s control over viewer events;
2) _root.outButton(); //to reactivate the container SWF’s control over viewer events.
example:
PHP Code:
btn_mc.onRollOver = function(){
_root.overButton();
…
}
btn_mc.onRollOut = function(){
_root.outButton();
…
}
stop();
-
If that's the only instructions you got, it would mean that the 2 functions exist in the main swf (the one that your file is loaded into)
So basically, all you would need to do is:
Give your buttons (unique) instance names (in this example 'btn_mc')
And use their code example and structure. As in:
btn_mc.onRollOver = function(){
_root.overButton();
}
btn_mc.onPress= function(){
getURL("www.link.com","_blank");
}
btn_mc.onRollOut = function(){
_root.outButton();
}
not sure, because there may be more in their documentation that you didn't post?
gparis
-
Hello gparis,
Thank you for the response. The rest of the specifications I was given is listed below:
_____
Please supply animation as Flash 6 files. You must supply both .swf and .fla files.
- Make sure there is no white space around the edge of the flash animation. Use a transparent background to define the correct area of the animation
- Set the flash file to a frame rate of 30 fps.
- For animations that shouldn't loop, please “action script” it as such.
- Any action script used in the animations cannot use the root reference. It must instead use parent references.
- If you wish links to be tracked via BlueToad’s statistics package, there should be no links in the animations we are given. We will create the links so they can be tracked.
- There is no file size limit on animations, but for loading purposes, the files should be as small as possible.
- Images should be set to lossless compression instead of photo compression.
_____
The magazine publication told me I could not use root references. Later, the digital vendor told me to use root.overButton(); and _root.outButton();
_____
I copied your code you provided in your post, but wasn't sure where I was suppose to put it? I put it on the button itself and got this output:
Symbol=site contents, Layer=Layer 1, Frame=1: Line 2: Statement must appear within on handler
btn_mc.onRollOver = function(){
Symbol=site contents, Layer=Layer 1, Frame=1: Line 5: Statement must appear within on handler
btn_mc.onPress= function(){
Symbol=site contents, Layer=Layer 1, Frame=1: Line 8: Statement must appear within on handler
btn_mc.onRollOut = function(){
_____
I then tried putting the code on the movie clip that contains the button and got a page load error in my internet browser when I clicked on the button. Essentially, it was trying to search for the link on my desktop where I saved my flash file.
_____
Does this make sense to you? Would it be helpful if I provide the file (may be too large to upload) or send you a link to view the finished product? I am so ready to be finished with this.
-
Codes now go on frames.
gparis
-
Thanks, gparis. I was way confused, because I was putting the code in the frame. I don't know what I was doing before, but it works now. Hopefully, this was what the digital publication people wanted.
Thanks, again!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|