I would go with David' suggestion of a container clip to assign the
behavior to, and a separate clip to load the image into so you don't
worry about the images being loaded, or, a function that checks to see
all the clips are loaded, and if so, then calls a separate function that
has a loop to assign the onRollOver actions.  Both approaches would have
their advantages and disadvantages.  And also mind Andrew's post where
he indicated you used RollOver instead of onRollOver.

Jason Merrill
Bank of America  
GT&O Learning & Leadership Development
eTools & Multimedia Team


 

>>-----Original Message-----
>>From: [EMAIL PROTECTED] 
>>[mailto:[EMAIL PROTECTED] On Behalf 
>>Of Gustavo Duenas
>>Sent: Friday, April 06, 2007 2:13 PM
>>To: [email protected]
>>Subject: Re: [Flashcoders] attaching an event to a movie clip
>>
>>k, once the image has been loaded, I'll try to attach the 
>>behaviors outside or inside of the loop?
>>
>>Regards
>>
>>Gustavo
>>should I write something like newMC.complete?
>>
>>Regards
>>
>>Gustavo Duenas
>>
>>
>>On Apr 6, 2007, at 2:01 PM, Merrill, Jason wrote:
>>
>>> You have to wait for the clips to fully load before assigning any 
>>> behaviors - otherwise the behaviors, like onRollover get 
>>overwritten 
>>> when the image finally loads.
>>>
>>> Jason Merrill
>>> Bank of America
>>> GT&O Learning & Leadership Development eTools & Multimedia Team
>>>
>>>
>>>
>>>
>>>>> -----Original Message-----
>>>>> From: [EMAIL PROTECTED]
>>>>> [mailto:[EMAIL PROTECTED] On Behalf
>>>>> Of Gustavo Duenas
>>>>> Sent: Friday, April 06, 2007 1:43 PM
>>>>> To: [email protected]
>>>>> Subject: [Flashcoders] attaching an event to a movie clip
>>>>>
>>>>> Hi , Ok it doesn't sound as simple,
>>>>>
>>>>> I've created a series of empty movieclips which loads pics
>>>>> from an array, so far it loads perfectly but I can attach to
>>>>> the newly created movie clip any kind of events.
>>>>>
>>>>> I'm using this.
>>>>>
>>>>> stop();
>>>>>
>>>>> var models = new Array();
>>>>>
>>>>> models = [ "model1", "model2", "model3", "model4"];
>>>>>
>>>>> trace(models.length);
>>>>> for (i=0; i<models.length; i++){
>>>>>   movieName=models[i];
>>>>>   var newMC= this.container1.createEmptyMovieClip(movieName, 0+i);
>>>>>   newMC.loadMovie("models/"+movieName+".jpg");
>>>>>     newMC._x=100*-i;
>>>>>   newMC._y=100*i;
>>>>>   trace (newMC);// so far works until here, creating the
>>>>> movieclips and loading the pics inside then and assigning
>>>>> them a respective value for x and y
>>>>>
>>>>> ///from now on, I got the problem, it appear that can't
>>>>> accept any event in the movie clips
>>>>>   newMC.rollOver= function(){
>>>>>           trace("hello");
>>>>>   }
>>>>>   
>>>>> }
>>>>>
>>>>> I hope you got it...because I'm still dont get it.
>>>>>
>>>>> Regards
>>>>>
>>>>>
>>>>> Gustavo Duenas
>>>>>
>>>>> _______________________________________________
>>>>> [email protected]
>>>>> To change your subscription options or search the archive:
>>>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>>>>
>>>>> Brought to you by Fig Leaf Software
>>>>> Premier Authorized Adobe Consulting and Training
>>>>> http://www.figleaf.com
>>>>> http://training.figleaf.com
>>>>>
>>> _______________________________________________
>>> [email protected]
>>> To change your subscription options or search the archive:
>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>>
>>> Brought to you by Fig Leaf Software
>>> Premier Authorized Adobe Consulting and Training
>>> http://www.figleaf.com
>>> http://training.figleaf.com
>>>
>>
>>_______________________________________________
>>[email protected]
>>To change your subscription options or search the archive:
>>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>>Brought to you by Fig Leaf Software
>>Premier Authorized Adobe Consulting and Training
>>http://www.figleaf.com
>>http://training.figleaf.com
>>
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to