Skip navigation
Currently Being Moderated

AS2 Clicktag and Rollover questions

Sep 22, 2011 1:39 PM

I'm creating a banner ad for Yahoo.com and am running into a conflict with the Rollover replay and Clicktag. Both are buttons on separate layers with the ClickTag on top. If the Clicktag button is on, the rollover (replay) button is ignored.

 

I'm wondering what changes I need to make, but I need to keep the AS2 out of the Clicktag button. Also, if I rollover and out quickly, the animation replays, when it should stop. Thanks for any help. I've attached my .fla CS4 for analyzing.

 

Yahoo specs of note:

  • Animation can begin again on mouse over, but must stop immediately on mouse off.
  • When building flash creative, please note that the expression box must be checked and the URL should say clickTag.

 

If you would like to see the CS4 file, which may explain a lot more, please visit this link.

http://board.flashkit.com/board/showthread.php?p=4291469#post4291469

 

Thanks again!

 

Rollover/replay AS2 code

on (rollOver) {

    this.play(2)

}

on (rollOut) {

    this.gotoAndStop(33)

}

 

Clicktag

on (release) {

getURL(clickTag, "_blank");

}

 
Replies
  • kglad
    72,260 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 22, 2011 3:13 PM   in reply to LuisRM

    remove all code from objects.  give both objects instance names (eg, clickTag_btn and replay_btn).  you can then use:

     

    clickTag_btn.onRelease=function(){

    getURL(clickTag,"_blank");

    }

    clickTag_btn.onRollOver=function(){

    this._parent.play(2);

    }

    clickTag_btn.onRollOut=function(){

    this._parent.gotoAndStop(33);

    }

     
    |
    Mark as:
  • kglad
    72,260 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 23, 2011 8:36 AM   in reply to LuisRM

    both buttons are attached to a timeline.  is that the timeline that you want to play(2) and gotoAndStop(33)?

     

    if yes, use the code i suggested.  if no, explain the relationship between the timeline that contains your code and the one you want to play(2).

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 23, 2011 10:11 AM   in reply to LuisRM

    Hello LuisRM & kglad,

     

    Any luck yet? I'm having the same problem but I must use the code bellow for the clickTAG. The ad server that I'm dealing with states the code must not be altered for it to work. Would using the solution above affect the outcome by assigning instances to the buttons? Sorry for any unintentional Flash/AS ignorance. Thanks.

     

    on (release) {

        if (clickTAG.substr(0,5)=="http:") {

            getURL (clickTAG, "_blank");

            }

    }

     
    |
    Mark as:
  • kglad
    72,260 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 23, 2011 12:07 PM   in reply to Cartomatics

    no.

     
    |
    Mark as:
  • kglad
    72,260 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 29, 2011 4:09 PM   in reply to LuisRM

    if the frame rate is low or the rollover is fast (or some combo of the two), the rollover can be missed by the flash player.  if the frame rate is low or the rollout from the button to off-stage is fast (or some combo of the two), the rollout can be missed by the flash player.

     

    you can often remedy any practical problems by increasing the frame rate to 24 or 30 fps.  it will still be possible to screw things up with fast movement, but that's not something that you need to worry about.  it's either you testing causing the problem or somebody screwing around with your swf.  anybody that wants to really use your flash app will less chaotic in their mouse movements.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points