AS 2 Button/Scene/Action Script issues in Rich Media Ads - Page 2
A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 30 of 30

Thread: Button/Scene/Action Script issues in Rich Media Ads

  1. #21
    Senior Member
    Join Date
    Nov 2001
    Posts
    1,093
    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.

  2. #22
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    936
    Exactly. That's one of the things I do sometimes
    Using movieclips frames as Scenes.
    Hi Object, Listen, i wish to return you something, but only if what you are saying is true, else, forget it, ROLL_OVER the floor, i will check for someone else at the stage, while eating a no.visible cookie.

  3. #23
    Junior Member
    Join Date
    Jan 2014
    Location
    Seattle, WA
    Posts
    12
    Quote Originally Posted by angelhdz View Post
    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!

  4. #24
    Senior Member
    Join Date
    Nov 2001
    Posts
    1,093
    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.

  5. #25
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    936
    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; }
    Hi Object, Listen, i wish to return you something, but only if what you are saying is true, else, forget it, ROLL_OVER the floor, i will check for someone else at the stage, while eating a no.visible cookie.

  6. #26
    Junior Member
    Join Date
    Jan 2014
    Location
    Seattle, WA
    Posts
    12
    Quote Originally Posted by angelhdz View Post
    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);
    }

  7. #27
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    936
    That code is for Actionscript 2, not actionscript 3.
    Hi Object, Listen, i wish to return you something, but only if what you are saying is true, else, forget it, ROLL_OVER the floor, i will check for someone else at the stage, while eating a no.visible cookie.

  8. #28
    Junior Member
    Join Date
    Jan 2014
    Location
    Seattle, WA
    Posts
    12
    Quote Originally Posted by angelhdz View Post
    That code is for Actionscript 2, not actionscript 3.
    I know. This whole forum section is for as2 right?

  9. #29
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    936
    Sorry, I wrote it backwards (i was sleepy)

    That code is for AS3, and this forum is AS2.
    Hi Object, Listen, i wish to return you something, but only if what you are saying is true, else, forget it, ROLL_OVER the floor, i will check for someone else at the stage, while eating a no.visible cookie.

  10. #30
    Senior Member
    Join Date
    Nov 2001
    Posts
    1,093
    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
  •  




Click Here to Expand Forum to Full Width


HTML5 Development Center

Poll by Flashkit.com