-
1. Re: Trouble with Looping in AS1
Ned Murphy Dec 11, 2009 9:08 AM (in response to andrewmcgibbon)Try:
Frame 1:
var i:Number;
if(!i) i = 0;
Frame 80:
i++;
if (i < 2){
gotoAndPlay(1);}
else {
gotoAndStop(1);
} -
2. Re: Trouble with Looping in AS1
andrewmcgibbon Dec 11, 2009 10:21 AM (in response to Ned Murphy)This worked great, however, now my clickTAG code isn't working. Here is the code that the agency gave me for the ad and they said it had to be exact. I have created a button and made sure this code was on the button and not on a frame. Any thoughts? Thank you so much for your help.
on(release) {
getURL(clickTAG, "_blank");
} -
3. Re: Trouble with Looping in AS1
andrewmcgibbon Dec 11, 2009 10:24 AM (in response to andrewmcgibbon)Ned, if you could also explain what this means:
if(!i) i = 0
I understand the variable declaration but the if(!i) I don't get.
Thanks again.
-
4. Re: Trouble with Looping in AS1
Ned Murphy Dec 11, 2009 12:39 PM (in response to andrewmcgibbon)i is undefined when you only declare it, so when you try to add 1 to it at the end of the timeline and return to frame 1 it is still undefined.
if(!i) i=0; basically says, if i doesn't have a value, assign it a value of zero. That way it can add the 1 at the end of the timeline so that when it gets back to frame 1 it isn't reset to be zero because assigning the zero value is conditional.
-
5. Re: Trouble with Looping in AS1
Ned Murphy Dec 11, 2009 10:34 AM (in response to andrewmcgibbon)That code is fine for a button. What does the "clickTAG" variable equate to?
-
6. Re: Trouble with Looping in AS1
andrewmcgibbon Dec 11, 2009 10:43 AM (in response to Ned Murphy)Thank you so much for that easily digestible explanation. As far as the clickTAG code, it apparently is a proprietary name put in by a 3rd party ad serving company.
-
7. Re: Trouble with Looping in AS1
Ned Murphy Dec 11, 2009 10:48 AM (in response to andrewmcgibbon)If the clickTag variable is assigned in the html code, then you probably need to test it thru a browser, if not entirely online... and maybe they do that for you, so you have no ability to test it.
-
8. Re: Trouble with Looping in AS1
andrewmcgibbon Dec 11, 2009 11:17 AM (in response to Ned Murphy)Very good. I'll go back to them with it. Thank you again for sharing your knowledge.


