all groups > flash actionscript > june 2005 >
You're in the

flash actionscript

group:

Firing Movie Clip-Need Assistance


Firing Movie Clip-Need Assistance ryanbutler
6/27/2005 7:23:00 PM
flash actionscript:
In my flash file I have several navigational buttons that have roll over events
in my main movie. When each button is rolled over quickly, the highlights which
are individual movie clips will jam up. I wrote a function that sets the
visible property of each movie clip to either true or false. Brief snippet is
below:



clipNames variable is already assigned an array of building names (graff, tec,
etc). Then to solve the jamming of movie clips, I set this function to null. My
issue is I can't get the individual movie clips to fire (highlight) on a roll
over. I know my roll over is working because I have ran trace multiple times.
The roll over code looks like this:




Inside my movie clips I tried setting this to make them fire in the main
timeline:



And nothing. Does anyone know what is causing these buttons not to fire the
movie clips? ActionScript is version 2.0.
http://midwestwebdesign.net/test/tour.zip is the fla file if that would help,
b/c I'm stumped.



function setHighlight(clip:String){
// here we pass in a string for the name of the clip we want to highlight
// ie: "graff"
"graff"
"lincoln"
"ic"
// next, loop through the array
for(var i=0;i<clipNameslength;i++){

// if the string passed in matches the current array item, highlight
it
if(clipNames[i]==clip){
this[clipNames[i]+"Hovermc"]._visible="true";
}

// if not, turn it off
else{
this[clipNames[i]+"Hovermc"]._visible="false";
}

}
}
setHighlight(null);
--------------------------------
my button below
this.graffBtn.onRollOver=function(){

_parent.setHighlight("graff");
}

my individual movie clips below
------------------------------------
_parent.clipNames="graff";
Re: Firing Movie Clip-Need Assistance zom
6/28/2005 12:00:00 AM
[quoted text, click to view]

use:

this[clipNames[i]+"Hovermc"]._visible=true;

also, you don't need the for loop, because you are already passing the name:
so:
this[clip+"Hovermc"]._visible=true;

should work. you can use rollOut to stop the highligth.

-Edwin
AddThis Social Bookmark Button