Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If then else

Status
Not open for further replies.

blues007

Technical User
Oct 25, 2005
59
PT
Can I use if then else in something like this:

If(onrelease)then
getURL("else
play();

I mean: if I click the button it opens an URL or else it rolls the rest of the movie
 
this could be done but only if you set a time limit within which the button has to be clicked

if Button clicked within 5 sec
then
getUrl
else
play on
 
No you wouldn't want to do that anyway. Flash movies "Play" by default. So you would just do something like this...

Code:
on(release){
    getURL("[URL unfurl="true"]http://somesite");[/URL]
    _level0.stop();
}

Or better yet would be to place the code on the main timeline...

Code:
buttonInstanceName.onRelease = function(){
    getURL("[URL unfurl="true"]http://somesite");[/URL]
    stop();
}

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
The thing is I have this button that is an image that expands it's size "onRollover" and returns to the normal size "onRollout". Plus I want it to have a link when I click on it but if I don't click on it (when it reaches the bigger size) it returns to normal size. I'll try your sugestions and I thank you very much.
 
And the button's movie hast a stop(); in the frame where it reaches it's maximum size so I must put a play(); anywhere so it goes on playing wether I rollOut or click.
 
The problem is not in the code. The code works fine when I open the .swf it in the player:

on(rollOut){
play(); /it plays on the rest of the clip
}
on(release){
getURL(" /it gets this URL when I click it
}

...but it doesn't run in my browser!(latest IE) What can this be?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top