Flash Help
- Started
- Last post
- 17 Responses
- nRIK
Hi,
so ive got a XML driven menu, it loads everything fine, attaches the menuitems to a MC, etc.What i want now, is to have a slight pause between loading each menuitem/node, so it gives an effect of loading one menu item at a time..
the only thing i can think of that is similar right now, is the menu nav on http://www.hi-res.net/
.. see how each menu item loads one at a time [with a pause in between]?help is very much appreciated,
- nRIK0
oh i got it so that when the XML is loaded, there is a for loop that iterates through each item in the document, and loads it one by one into their MCs... could i place a timer or a wait() or something similar before the next loop iterates? or a check to see if the attachedMC has loaded and played all its animation?
sorry, i am relatively new to AS, but i do have a good understanding to other OO languages, just trying to get my head around timebased scripting
also I know its the weekend, and everything -- planning on doing an all nighters till sunday/monday; just got too much work to finish..
- nRIK0
sorry man, didnt work :( thx tho
i think that only calls a certain function every such-and-such seconds..
ok, say i had a for loop:
for ( var i=0; i
- fusionpixel0
create a loading animation in the "master" MC that holds the menu animation.
I would do a fade or color change for like 12-17 frames if you have your movie at 30 fps.
- nRIK0
alright, the "master" MC i think is the movieclip which I use to attach the menuitems to, is this correct?
curr_item = curr_menu.attachMovie("mc_menuit... i);
so its "mc_menuitem"
i do have an animation in the MC, but its another movieclip
what else should i do?
- nRIK0
aw crap, NT cut my code in the previous for loop thing
hold on, ill use pastebin
http://pastebin.coconut.se/?id=3…
there u go
- fusionpixel0
yeah the "mc_menuitem" needs the animation.
To see how it works open mc_menuitem
create an animation in a different layer so you dont mess it up. like a square changing colors or whatever. once you see it is working animate that MC the way you want it.
You might have to animate the TextField or you dont, depends on what you need.
If you animate the Text field you will have to reconfigure where the Variable that holds that menu is. but im sure you will figure that part. if you cant post again where you are stuck.
- nRIK0
yeap ok i did that
its still loading it the same way, it didnt make much of a difference
could u look at the for loop i have?
http://pastebin.coconut.se/?id=3…
see how its generating, or attaching a MC on every iteration? i need that pause in between each iteration
thx for the help so far btw
- fusionpixel0
i see...
ok, this might not be the best approach but I would have the mc_menuitem call the next item.
for example
frame 1- loads menu
frame 2to15- simple fade animation
frame 16 - function that calls for the next menu item.make sense?
- nRIK0
yep it does, i thought of doing that, but that would quite work properly i think- i wouldnt have much control over the next item, or how many items to create and referencing may get outtahand
would u by anychance know the code to test if the newMC had finished loading?
say like
curr_item = curr_menu.attachMovie(...)
if [curr_item finished loading] {
do blah
}probably better to do a while loop, and will keep doing whatever until its finished loading and go onto the next for loop iteration.. does that make sense?
- fusionpixel0
It reallity it wont be that much of work, just add a couple of variables in the "mastermc" and it will automaticly will stop looking for the next menu item.
but I would like to see what you do with the loading code
http://pastebin.coconut.se/?id=3…
let me know if that helps.
- nRIK0
yea ah i just realised that wont help much, cuz the mcs load very quickly, so u dont notice any pauses at all
btw, when testing a movie, the trace statements u make should appear in the "output" panel, right?
for some reason, none of my trace statements display at all :S
- fusionpixel0
yeah, that is what I thought it was going to happen. Like I say I would have the "mastermc" recall the function once the small animation has happened.
and yes, your trace should show on your output window.
- nRIK0
thx unfittoprint it works, but the way i got it setup [ive already got a recursive call to generate submenus] it clashes somewhat, and only generates the first menuitem
i think ill leave this for now
thx everyone for the helpone thing before i go tho, say I have a string that contains:
"_level0.mc_mainmenuitem4_mc"
is there any way i can use that to reference the actual MC?
- fusionpixel0
this[ "_level0.mc_mainmenu item4_mc"].gotoAndPlay(4);
i think
- nRIK0
bah after 20 mins i finally worked out whats wrong with the string referencing :@
its actually:
unselect=eval(_root.curr_selecte...
unselect.name.textColor=0x9da4a5...and i wasnt referencing it properly, but all is good now