-
I always talk about it because it takes a long time to figure out for yourself. Scenes are there for people who don't use actionscript or very little actionscript to control their movies. You can use a little actionscript to control which scenes play when and you can make a whole "movie."
You still draw stuff on the stage and animate with tweens and frames. Just put everything in clips (container clips) for easy reference and management. Use _visible to show the clips when you need to.
-
Designer, Programmer, Musician
Exactly. That's one of the things I do sometimes
Using movieclips frames as Scenes.
Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries
-
Originally Posted by angelhdz
Exactly. That's one of the things I do sometimes
Using movieclips frames as Scenes.
OK. What you and moot are saying makes sense. I'll try containing animations inside movie clips in the future, rather than executing right on the timeline. I'm pretty self-taught when it comes to Flash, so these nuggets of advice really help!
Anther quick question, Any thoughts on disabling auto contract if a user clicks on the arrows in the ad? Right now if a person starts interacting with the timeline, it collapses after 7 seconds regardless.
Here's the ads to see:
http://www.flashtalking.net/view/667437/
And here's the FLAs:
https://www.hightail.com/download/el...TmFVbS9xYk1UQw
Thanks for all your help!
-
Whoever is running the ad will give you all those rules. Because the ad's behavior affects the page the ad is on, it's up to the site owner. It should be on their site or it may be something that changes based on how much you pay.
-
Designer, Programmer, Musician
I don't think there's a way of controlling the contract/expand functions,because they are stored inside the Components, and I can not edit the components. If I could, I would make if(disabledContract == false) { contract(); } whenever it fires the contract function, and on the arrows arrow.onPress = function() { disabledContract = true; }
Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries
-
Originally Posted by angelhdz
I don't think there's a way of controlling the contract/expand functions,because they are stored inside the Components, and I can not edit the components. If I could, I would make if(disabledContract == false) { contract(); } whenever it fires the contract function, and on the arrows arrow.onPress = function() { disabledContract = true; }
Here's what Flashtalking is suggesting. Make any sense?
I usually use something like this to set an auto expand and then to get rid of the timer if the user clicks on the ad.
On frame two of my ad I set the interval I want to use.
var myInterval:uint = setInterval(ad_contract_auto,4000);
Then on the expand frame I'll set my auto close function
function ad_contract_auto():void {
gotoAndPlay("contract");
clearInterval(myInterval);
}
I will then make a button that fires the clearinterval function when clicked.
myBtn.addEventListener(MouseEvent.CLICK, clear_timer);
function clear_timer(event:MouseEvent):void
{
clearInterval(myInterval);
}
-
Designer, Programmer, Musician
That code is for Actionscript 2, not actionscript 3.
Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries
-
Originally Posted by angelhdz
That code is for Actionscript 2, not actionscript 3.
I know. This whole forum section is for as2 right?
-
Designer, Programmer, Musician
Sorry, I wrote it backwards (i was sleepy)
That code is for AS3, and this forum is AS2.
Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries
-
You can use a timer - setInterval.
Here's some example code. It sets a var bUserInteracting to prevent the auto close if the user is doing something. It sets an interval (as2 timer) that calls the function doAutoClose after 2 seconds (2000 milliseconds). In doAutoClose, if bUserInteracting is false (!), the interval is cleared so it doesn't keep repeating every 2 seconds.
Code:
bUserInteracting = false;
intMain = setInterval(doAutoClose,2000);
function doAutoClose(){
if(!bUserInteracting){
trace("doAutoClose()");
clearInterval(intMain);
}
}
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
|