Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE FLASH: Adobe Flash ForumAdobe Flash TutorialsAdobe Flash Video TutorialsWeb Streaming ForumAdobe Flash

load movie clip... i think

Cow Forums : Adobe Flash
load movie clip... i think
by Ari Grunzeweig (Ari) on Jul 1, 2008 at 5:52:52 pm

Hi,

I have the following code to make a movie clip appear when the user rolls over a symbol.

The part I am missing is how to make that movie clip appear.
I can't seem to figure that out.

I will have about 20 symbols that each need a different movie clip to appear on the screen as it is rolled over... this is the code for one of those symbols.

sourceGlass_mc.addEventListener(MouseEvent.ROLL_OVER, sourceGlassOver);
function sourceGlassOver(event:MouseEvent):void
{

}

sourceGlass_mc.buttonMode = true;

Any ideas?
Thanks!!



Respond to this post     Return to posts index

Re: load movie clip... i think
by Sher Ali on Jul 1, 2008 at 6:31:45 pm

lets you have 5 movieclips and you have named all of your movieclips on the stage as mc1, mc2, mc3 etc. then you can associate an ID with each button which can be used inside the sourceGlassOver handler function to show the respective movieclip. For I give an ID value of 1 to sourceGlass_mc, like:

sourceGlass_mc.ID = 1;
sourceGlass_mc.addEventListener(MouseEvent.ROLL_OVER, sourceGlassOver);
function sourceGlassOver(event:MouseEvent):void
{
for(var i:Number=0;i<5;i++){
if( "mc"+event.currentTarget.ID == MovieClip(this.getChildByName("mc"+(i+1))).name.substr(2) ){
MovieClip(this.getChildByName("mc"+(i+1))).visible = true;
}
}
}

sourceGlass_mc.buttonMode = true;


If you are creating movieclips and buttons through actionscript then it can be more easy by storing them in arrays. There can be many other ways to achieve what you are trying to.


Sher Ali
Flash & Flex Developer
My FlashDen Portfolio
website: http://www.webeyestudio.com
blog: http://www.kabulinteractive.com/blog


Respond to this post     Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINEDVDsBOOKSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]