Groups | Blog | Home
all groups > flash actionscript > february 2004 >

flash actionscript : ifFramesLoaded variables with buttons


cybereaper
2/15/2004 5:46:44 PM
I want to use a button to accomplish this basic function
on(release)
if mymovieclip= is currently on frame 1
do nothin
else if mymovieclip = is currently on frame
tellTarget=("mymovieclip")
gotoAndPlay(2)


I am not sure how to create an if /else if statement for this case. Here was
my attempt at a solution
//on release function to find out what frame the embeded movie clip was in and
take an action upon i
on (release)
_root.whole.srscircle.getFramesLoaded ()
ifFrameLoaded (1)
tellTarget ("_root.whole.srscircle")
gotoAndPlay(10)



//without the 'else if' function, I've now used a second on(release) to find
out where if the movie clip is on a different frame and take action upon it
on(release)
_root.whole.srscircle.getFramesLoaded ()
ifFrameLoaded (10)
tellTarget ("_root.whole.srscircle")
gotoAndPlay(2)



--my attemp at a solution has not worked (obviously). I would love some
ideas/suggestions/solution?? :) thank
stwingy
2/15/2004 6:17:54 PM
i may be misunderstanding what you are trying to do but if the button is on the mc`s timeline couldn`t you just type
on (release) {
if (_currentframe == 10) {
gotoAndPlay(2);
}
cybereaper
2/15/2004 9:21:31 PM
That's part of the problem, it's not. The timeline is as follows
main movie
whole(mainmc)
circlemovieclip navbarmovieclip othermc otherm
buttonconfigm
mybutton_bt

I am trying to use the 'mybutton_btn' under the navbarmc to affect actions in
the circlemc. That's part of the reason I was using
//where all movies are contained within the "whole" mc on the "_root" base
tellTarget ("_root.whole.srscircle")

I only did it this way to start making control of movies easier for myself. I
am a newbie and have no books or guidance except tutorials. I read somewhere
that this might help, so I am trying it this way. Don't know if that's right.
But as to my prior question:
Now I have
_root.whole.navbar.buttonconfig //where the buttons themselves are located,
and obviously their actionscrip
//to control the mc
_root.whole.srscircl
//using the idea that the movie is at a certain frame for an action to occu
cybereaper
2/15/2004 9:25:58 PM
I thought I should add that I could use the "_parent" command as all mc's are
contained within the parent, and that would avoid a long, drawn out sequence.
I have just avoided that so far to get accustomed to writing script and code.
I am not sure where the "this.mc" would come into play in this instance, if at
all
AddThis Social Bookmark Button