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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW WOULD YOU MODIFY THIS ACTIONSCRIPT?

Status
Not open for further replies.

oldnewbie

Technical User
Dec 6, 2000
9,142
CA
This script works to a certain extent...

On (Roll Over)
Begin Tell Target ("/movie1")
Go to and Play (2)
End Tell Target
End On
On (Roll Out)
Begin Tell Target ("/movie1")
Go to and Play (14)
End Tell Target
End On

How would you add a conditional statement so that on (Roll Out) only occurs when movie1 has played up to frame 13.

Thanks for your help!

;-)


 
Hello.
Well I modified the code so that you could achieve what you asked, and I also modified it a little more so that rolling over it twice will not interrupt it while it is playing. Since I don't know what you're using this for, it may not be any use though. Anyway, the first code is what you asked for and the second is my version. Hope this helps :)

Code:
on (rollOver) {
    tellTarget ("/movie1") {
        gotoAndPlay (2);
    }
}
on (rollOut) {
    if (getProperty(&quot;/movie1&quot;, _currentframe)<13) {
        tellTarget (&quot;/movie1&quot;) {
            play ();
        }
    } else {
        tellTarget (&quot;/movie1&quot;) {
            gotoAndPlay (14);
        }
    }
}

Below is another version:

Code:
on (rollOver) {
    if (getProperty(&quot;/movie1&quot;, _currentframe)>1) {
        tellTarget (&quot;/movie1&quot;) {
            play ();
        }
    } else {
        tellTarget (&quot;/movie1&quot;) {
            gotoAndPlay (2);
        }
    }
}
on (rollOut) {
    if (getProperty(&quot;/movie1&quot;, _currentframe)<13) {
        tellTarget (&quot;/movie1&quot;) {
            play ();
        }
    } else {
        tellTarget (&quot;/movie1&quot;) {
            gotoAndPlay (14);
        }
    }
}


JuiCe
 
Thanks JuiCe!
But a few problems still:
Would this script be possible in Flash 4? I've at this point never seen the use of &quot;{}&quot;, &quot;()&quot; after a Play command, even &quot;;&quot; after functions. Should I be using the expression editor for the full rollover and rollout functions? And if so, how do I manage to do that? In the actions editor if you for instance eliminate &quot;end tellTarget&quot; you lose &quot;begin tellTarget&quot; as well at the same time.
As for the use of this whole thing... outside of trying to learn actionscripting myself, I'm trying to help another user... see the BUTTON MOVIES thread below.
You can always have a look at what we presently have at:

Thanks again, and waiting for your reply!

;-)
 
Yes Flash 5 uses different scripting than the previous version. Just use my code as a guideline and make yours with the expression editor. Your finished code should look something like this:

On (Roll Over)
if (getProperty(&quot;/movie1&quot;, _currentframe)>1)
Begin Tell Target (&quot;/movie1&quot;)
Play
End Tell Target
else
Begin Tell Target (&quot;/movie1&quot;)
Go to and Play (2)
End Tell Target
End On

On (Roll Out)
if (getProperty(&quot;/movie1&quot;, _currentframe)<13)
Begin Tell Target (&quot;/movie1&quot;)
Play
End Tell Target
else
Begin Tell Target (&quot;/movie1&quot;)
Go to and Play (14)
End Tell Target
End On

Now it's been a while since I worked with Flash 4 but that should be about right. If you need any additional help, I'll publish the FLA in Flash 4 format and send it to you so you can better see the code. Hope this helps :)
 
Guys, many thanks for your interest!
But Supra... this doesn't really work either!
On a quick mouseout, the panel will now slide to it's fullest extension... but since there a stop on frame 13 of movie1 it will not slide back in as it should 'cause the mouse ain't there anymore! Furthermore, on a second mouse rollover... the panel will jumpcut from it's extended position to its hidden and sliding out state. Could add new conditions on rollover(such as if the panel is extended, slide it back in before you slide back out!)... but at one point the whole thing gets pretty confusing! Could change the stop in the movie1 for a hold and an automatic slide back in and no action on rollout, but the whole point of this was having the filename exposed as long as the mouse is over the thumb.
Maybe this should be written differently! Maybe on the panel's xposition... the rollout reversing the action from the position the rollover left it in.
Any other thoughts?
Simple but challenging no?

Thanks again,

François Gill ;-)
 
Darn right this is starting to irritate me :)
Could you email me the FLA? Send to j.ski@angelfire.com and i'll fix it. Then i'll just send it back to you and you'll be on your way ;p

JuiCe
 
Thanks again JuiCe for all your help!
Looked at your stuff... great!
Can I record the music off your mixer and use it in my own movies?
A last comment... you may want to add a progress bar on the loading. Files are big, and with Fortunecity in particular, users may eventually think they're caught in a loop, and leave before they get to see anything!

Regards, oldnewbie ;-)
 
I dunno how you're going to &quot;record&quot; the music from my mixer, but if you do, I only ask that you supply this link somewhere in your movie:


I created 3 of the 5 loops there using Beat2000 and ReBirth. Thanks :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top