-
button, image and if statement soup
i have 9 images. the one that loads in is based on the number established by the variable loopCount, which increases by 1 each time the main movie loops. Based on what value loopCount has at the time, i want a matching button to appear. For example:
loopCount has the number 5 assigned to it this time around...
image 5 loads in...
button 5 needs to load in to match.
i am guessing its some simple if statement, but i am at a loss. here is my attempt at the code:
PHP Code:
loopCount++;
_root.allPacks.pack1.enabled=false;
_root.allPacks.pack2.enabled=false;
_root.allPacks.pack3.enabled=false;
_root.allPacks.pack4.enabled=false;
_root.allPacks.pack5.enabled=false;
_root.allPacks.pack6.enabled=false;
_root.allPacks.pack7.enabled=false;
_root.allPacks.pack8.enabled=false;
_root.allPacks.pack9.enabled=false;
_root.allPacks.pack1._visible=false;
_root.allPacks.pack2._visible=false;
_root.allPacks.pack3._visible=false;
_root.allPacks.pack4._visible=false;
_root.allPacks.pack5._visible=false;
_root.allPacks.pack6._visible=false;
_root.allPacks.pack7._visible=false;
_root.allPacks.pack8._visible=false;
_root.allPacks.pack9._visible=false;
//all are set to enabled false and visible false to start off with.
-
that is the section i am having problems with, but here is the full code so you can see where i am coming from...
PHP Code:
loopCount++;
envelope = "HeaderImages/C"+loopCount+"/Envelope.png";
f_letterhead = "HeaderImages/C"+loopCount+"/F_Letterhead.png";
b_letterhead = "HeaderImages/C"+loopCount+"/B_Letterhead.png";
f_businesscard = "HeaderImages/C"+loopCount+"/Front_BC.png";
b_businesscard = "HeaderImages/C"+loopCount+"/Back_BC.png";
/*trace(envelope);
trace(f_letterhead);
trace(b_letterhead);
trace(f_businesscard);
trace(b_businesscard);*/
packButton = "pack"+loopCount;
_root.allPacks.pack1.enabled=false;
_root.allPacks.pack2.enabled=false;
_root.allPacks.pack3.enabled=false;
_root.allPacks.pack4.enabled=false;
_root.allPacks.pack5.enabled=false;
_root.allPacks.pack6.enabled=false;
_root.allPacks.pack7.enabled=false;
_root.allPacks.pack8.enabled=false;
_root.allPacks.pack9.enabled=false;
_root.allPacks.pack1._visible=false;
_root.allPacks.pack2._visible=false;
_root.allPacks.pack3._visible=false;
_root.allPacks.pack4._visible=false;
_root.allPacks.pack5._visible=false;
_root.allPacks.pack6._visible=false;
_root.allPacks.pack7._visible=false;
_root.allPacks.pack8._visible=false;
_root.allPacks.pack9._visible=false;
_root.allPacks.enabled=true(packButton);
_root.allPacks._visibe=true(packButton);
mc_envelope.loadMovie(envelope);
mc_let_front.loadMovie(f_letterhead);
mc_let_back.loadMovie(b_letterhead);
mc_bc_front.loadMovie(f_businesscard);
mc_bc_back.loadMovie(b_businesscard);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|