RE: [Flashcoders] attaching an event to a movie clip

2007-04-10 Thread Tony Accurso
CAN YOU PLEASE REMOVE MY EMAIL FROM THIS LIST? YOUR WEBSITE DOES NOT WORK IN 
REMOVING IT. I WILL REPORT YOU AS A VIOLATION OF THE CANN-SPAM ACT, I HAVE 
SENT EMAILS BEFORE REGARDI G THIS


Original Message Follows
From: Jesse Graupmann [EMAIL PROTECTED]
Reply-To: flashcoders@chattyfig.figleaf.com
To: flashcoders@chattyfig.figleaf.com
Subject: RE: [Flashcoders] attaching an event to a movie clip
Date: Fri, 6 Apr 2007 13:56:08 -0700
MIME-Version: 1.0
Received: from chattyfig.figleaf.com ([146.145.88.77]) by 
bay0-mc8-f7.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Fri, 6 
Apr 2007 14:02:57 -0700
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])by 
chattyfig.figleaf.com (Postfix) with ESMTP id 4F8745E1FE8;Fri,  6 Apr 2007 
16:02:52 -0400 (EDT)
Received: from enterprise.dns-nac-zone.com (unknown [207.99.65.32])by 
chattyfig.figleaf.com (Postfix) with ESMTP id BD1C15E1CB7for 
flashcoders@chattyfig.figleaf.com;Fri,  6 Apr 2007 16:02:17 -0400 (EDT)
Received: from c-24-19-42-102.hsd1.mn.comcast.net 
([24.19.42.102]:1262helo=AMD64X2) by enterprise.dns-nac-zone.com with esmtp 
(Exim 4.63)(envelope-from [EMAIL PROTECTED]) id 
1HZvTp-0003cQ-IOfor flashcoders@chattyfig.figleaf.com; Fri, 06 Apr 2007 
21:56:21 +0100
X-Message-Info: 
txF49lGdW41lf1H3XdHksU7aNwyk7PJZlFoY/7Q/OB06H9FXnsZwLb1WccYJRJB4

X-Original-To: flashcoders@chattyfig.figleaf.com
Delivered-To: flashcoders@chattyfig.figleaf.com
References: 
[EMAIL PROTECTED][EMAIL PROTECTED]

X-Mailer: Microsoft Office Outlook 11
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Thread-index: Acd4gCxvbQF/5b9ATquXqmgaVTsJPgAAZ3ygAAKzM/A=
X-Pass-two: yes
X-AntiAbuse: This header was added to track abuse,please include it with any 
abuse report

X-AntiAbuse: Primary Hostname - enterprise.dns-nac-zone.com
X-AntiAbuse: Original Domain - chattyfig.figleaf.com
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - jessegraupmann.com
X-Source:
X-Source-Args:
X-Source-Dir:
X-BeenThere: flashcoders@chattyfig.figleaf.com
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: flashcoders.chattyfig.figleaf.com
List-Unsubscribe: 
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders, 
mailto:[EMAIL PROTECTED]

List-Archive: http://chattyfig.figleaf.com/mailman/private/flashcoders
List-Post: mailto:flashcoders@chattyfig.figleaf.com
List-Help: mailto:[EMAIL PROTECTED]
List-Subscribe: 
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders,mailto:[EMAIL PROTECTED]

Errors-To: [EMAIL PROTECTED]
Return-Path: [EMAIL PROTECTED]
X-OriginalArrivalTime: 06 Apr 2007 21:03:08.0945 (UTC) 
FILETIME=[FAA98010:01C7788E]


Or you can use the MovieClipLoader()...




//
//  DATA
//


imageData =
{
dir: models/,
ext: .jpg,
images: [
 {title:'myfirst', path:image1},
 {title:'mysecond', path:image2}
 ],
clips: []
};

//
//  CREATE
//

var xspace = 100;
var yspace = 100;
var holder = this.createEmptyMovieClip ( 'holder',
this.getNextHighestDepth();
var len = imageData.images.length;

for (i = 0; i  len; i++)
{
var mc = holder.createEmptyMovieClip ( 'mc_'+ i,
holder.getNextHighestDepth() )
mc.image = mc.createEmptyMovieClip ( 'image',
mc.getNextHighestDepth() )

mc.loader = new MovieClipLoader();
mc.loader.addListener( mc );
mc.onLoadInit = proxyBEFORE ( this, image_onLoadInit, i );
mc.onLoadError = proxyBEFORE ( this, image_onLoadError, i );
mc.loader.loadClip( imageData.dir + imageData.images[i].path +
imageData.ext, mc.image );

mc.id = i;
mc._x= xspace * -i;
mc._y = yspace * i;

imageData.clips.push ( mc );
}

//
//  LOADING
//

function image_onLoadError ( id, image )
{
var mc = imageData.clips [ id ];
trace( 'image not loaded for: ' + mc );
}

function image_onLoadInit ( id, image )
{
var mc = imageData.clips [ id ];

delete mc.loader;
delete mc.onLoadInit;

mc.onRollOver = function()
{
var title = imageData.images [ id ].title;
var path = imageData.images [ id ].path;

trace( 'title: ' + title +  '  path: ' + path )
}
}


//
//  PROXY
//

function proxyBEFORE (s:Object, func:Function):Function
{
// from jgDelegate
var a:Array = arguments.slice(2, arguments.length);
return function ():Void { func.apply(s, a.concat(arguments));};
}






_

Jesse Graupmann
www.jessegraupmann.com
www.justgooddesign.com/blog/
_




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of David Ngo
Sent: Friday, April 06, 2007 12:30 PM
To: flashcoders

Re: [Flashcoders] attaching an event to a movie clip

2007-04-10 Thread Glen Pike

Hi,

Tony Accurso wrote:
CAN YOU PLEASE REMOVE MY EMAIL FROM THIS LIST? YOUR WEBSITE DOES NOT 
WORK IN REMOVING IT. I WILL REPORT YOU AS A VIOLATION OF THE CANN-SPAM 
ACT, I HAVE SENT EMAILS BEFORE REGARDI G THIS




   The list broke a few weeks ago and messages were posted to tell 
everybody about this.


   People have also repeatedly told others how to unsubscribe - see 
copied message below.**


   Marking the subject Unsubscribe may help too.

   Shouting does not.



 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf 
 Of Dave Watts

 Sent: Wednesday, February 28, 2007 19:38
 To: flashcoders@chattyfig.figleaf.com
 Cc: [EMAIL PROTECTED]
 Subject: RE: [Flashcoders] Flash 9 AS3 Resource Management
 
  
  I have tried several times to remove myself from this email 
  list to no avail. Can someone please remove me?

 
 In the future, if you need help on a list, PLEASE CONTACT THE 
 LIST OWNER DIRECTLY. It is a mistake to assume that the list 
 owner will read every message sent to the list, because the 
 list owner has a day job. To contact the list owner, you 
 click on the link at the bottom of the list information

 page:
 
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 Fortunately, in this case, your message subject, RE: 
 [Flashcoders] Flash 9
 AS3 Resource Management, let me see in an instant that you 
 needed help from the list owner. Per your request, you have 
 been unsubscribed.
 
 Dave Watts, CTO, Fig Leaf Software

 http://www.figleaf.com/
  


___
Flashcoders@chattyfig.figleaf.com
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

___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] attaching an event to a movie clip

2007-04-10 Thread Glen Pike

Hi,

Tony Accurso wrote:
CAN YOU PLEASE REMOVE MY EMAIL FROM THIS LIST? YOUR WEBSITE DOES NOT 
WORK IN REMOVING IT. I WILL REPORT YOU AS A VIOLATION OF THE CANN-SPAM 
ACT, I HAVE SENT EMAILS BEFORE REGARDI G THIS




   The list broke a few weeks ago and messages were posted to tell 
everybody about this.


   People have also repeatedly told others how to unsubscribe - see 
copied message below.**


   Marking the subject Unsubscribe may help too.

   Shouting does not.



 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf 
 Of Dave Watts

 Sent: Wednesday, February 28, 2007 19:38
 To: flashcoders@chattyfig.figleaf.com
 Cc: [EMAIL PROTECTED]
 Subject: RE: [Flashcoders] Flash 9 AS3 Resource Management
 
  
  I have tried several times to remove myself from this email 
  list to no avail. Can someone please remove me?

 
 In the future, if you need help on a list, PLEASE CONTACT THE 
 LIST OWNER DIRECTLY. It is a mistake to assume that the list 
 owner will read every message sent to the list, because the 
 list owner has a day job. To contact the list owner, you 
 click on the link at the bottom of the list information

 page:
 
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 Fortunately, in this case, your message subject, RE: 
 [Flashcoders] Flash 9
 AS3 Resource Management, let me see in an instant that you 
 needed help from the list owner. Per your request, you have 
 been unsubscribed.
 
 Dave Watts, CTO, Fig Leaf Software

 http://www.figleaf.com/
  


___
Flashcoders@chattyfig.figleaf.com
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

___
Flashcoders@chattyfig.figleaf.com
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


RE: [Flashcoders] attaching an event to a movie clip

2007-04-06 Thread Merrill, Jason
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  
GTO 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: Flashcoders@chattyfig.figleaf.com
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; imodels.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

___
Flashcoders@chattyfig.figleaf.com
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

___
Flashcoders@chattyfig.figleaf.com
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


RE: [Flashcoders] attaching an event to a movie clip

2007-04-06 Thread Rost, Andrew
newMC.rollOver

Should be:

newMC.onRollOver

HTH

-Original Message-
From: Gustavo Duenas [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 06, 2007 12:43 PM
To: Flashcoders@chattyfig.figleaf.com
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; imodels.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

___
Flashcoders@chattyfig.figleaf.com
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
___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] attaching an event to a movie clip

2007-04-06 Thread Gustavo Duenas
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
GTO 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: Flashcoders@chattyfig.figleaf.com
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; imodels.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

___
Flashcoders@chattyfig.figleaf.com
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


___
Flashcoders@chattyfig.figleaf.com
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



___
Flashcoders@chattyfig.figleaf.com
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


RE: [Flashcoders] attaching an event to a movie clip

2007-04-06 Thread David Ngo
What you can also do is create a nested MovieClip and load your image on
that. That way, you set your handlers on the parent clip and don't have to
worry about when it loads.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Merrill,
Jason
Sent: Friday, April 06, 2007 11:01 AM
To: flashcoders@chattyfig.figleaf.com
Subject: RE: [Flashcoders] attaching an event to a movie clip

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  
GTO 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: Flashcoders@chattyfig.figleaf.com
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; imodels.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

___
Flashcoders@chattyfig.figleaf.com
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

___
Flashcoders@chattyfig.figleaf.com
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

___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] attaching an event to a movie clip

2007-04-06 Thread Gustavo Duenas
I did, but it is the same...nothing so far...I guess that one of you  
maybe have been in this problem before...so I'd like to know how can  
I finish it.



Regards


Gustavo
On Apr 6, 2007, at 2:04 PM, Rost, Andrew wrote:


newMC.rollOver

Should be:

newMC.onRollOver

HTH

-Original Message-
From: Gustavo Duenas [mailto:[EMAIL PROTECTED]
Sent: Friday, April 06, 2007 12:43 PM
To: Flashcoders@chattyfig.figleaf.com
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; imodels.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

___
Flashcoders@chattyfig.figleaf.com
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
___
Flashcoders@chattyfig.figleaf.com
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



___
Flashcoders@chattyfig.figleaf.com
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


RE: [Flashcoders] attaching an event to a movie clip

2007-04-06 Thread Merrill, Jason
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  
GTO 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: flashcoders@chattyfig.figleaf.com
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
 GTO 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: Flashcoders@chattyfig.figleaf.com
 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; imodels.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

 ___
 Flashcoders@chattyfig.figleaf.com
 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

 ___
 Flashcoders@chattyfig.figleaf.com
 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


___
Flashcoders@chattyfig.figleaf.com
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

___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] attaching an event to a movie clip

2007-04-06 Thread leolea
You could try creating a container movieclip inside your clip and load the
image inside that clip.

for (i=0; imodels.length; i++){
 movieName = models[i];
 var newMC = this.container1.createEmptyMovieClip(movieName, 0+i);

 // here, create a mc inside newMC
 var imageMC = newMC.createEmptyMovieClip(container,0);

 //loadMovie inside that mc
 imageMC.loadMovie(models/+movieName+.jpg);

 // and then leave the rest as it is (exept for the onRollOver thingy)
 newMC._x=100*-i;
 newMC._y=100*i;
 newMC.onRollOver= function(){
  trace(hello)
 };
}


On 4/6/07 1:43 PM, Gustavo Duenas [EMAIL PROTECTED]
wrote:

 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; imodels.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
 
 ___
 Flashcoders@chattyfig.figleaf.com
 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


___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] attaching an event to a movie clip

2007-04-06 Thread john robinson
You have 2 choices so far... you can set up a poll (using onEnterFrame) 
to figure out when the images have finished loading and then attach the 
events or you can do as David suggested and nest your images inside 
another clip. I don't really know if either solution is better than the 
other, but with the code you already have and what David suggested you 
can make a few changes and probably get by. Some code:



var models = new Array();

models = [ model1, model2, model3, model4];

trace(models.length);
for (i=0; imodels.length; i++){
movieName=models[i];
var newMC= this.container1.createEmptyMovieClip(movieName, 0+i);

// create another mc inside newMC to load your images into
var img_mc = newMC.createEmptyMovieClip(image_mc, 1);
// load your image
img_mc.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.onRollOver= function(){
trace(hello);
}

}


Hope it helps. Keep in mind that this doesn't let you adjust the size 
of the image. For that you'll have to go the other route and wait until 
the image has fully loaded. You could do that using the code above, but 
attach an onEnterFrame to your newMC... like so:



newMC.onEnterFrame = function() {
var bl = img_mc.getBytesLoaded();
var bt = img_mc.getBytesTotal();
if(bl == bt  bt  0) {
delete this.onEnterFrame;
// your image is now loaded... do whatever you want here.
}
}


John




On Apr 6, 2007, at 2:25 PM, Gustavo Duenas wrote:

I did, but it is the same...nothing so far...I guess that one of you 
maybe have been in this problem before...so I'd like to know how can I 
finish it.



Regards


Gustavo
On Apr 6, 2007, at 2:04 PM, Rost, Andrew wrote:


newMC.rollOver

Should be:

newMC.onRollOver

HTH

-Original Message-
From: Gustavo Duenas [mailto:[EMAIL PROTECTED]
Sent: Friday, April 06, 2007 12:43 PM
To: Flashcoders@chattyfig.figleaf.com
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; imodels.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

___
Flashcoders@chattyfig.figleaf.com
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
___
Flashcoders@chattyfig.figleaf.com
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



___
Flashcoders@chattyfig.figleaf.com
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



___
Flashcoders@chattyfig.figleaf.com
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


RE: [Flashcoders] attaching an event to a movie clip

2007-04-06 Thread Steven Sacks | BLITZ
Here's a quick and dirty example:

this.createEmptyMovieClip(img, 10);
img.loadMovie(some.jpg);
this.onEnterFrame = function() {
if (img._width  2) {
this.assignActions();
delete this.onEnterFrame;
}
};
function assignActions()
{
img.onRollOver = function() {
// do something
};
img.onRollOut = function() {
// do something
};
img.onRelease = function() {
// DO SOMETHING!
};
}
___
Flashcoders@chattyfig.figleaf.com
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


RE: [Flashcoders] attaching an event to a movie clip

2007-04-06 Thread David Ngo
Personally, I find onEnterFrames bad practice to use unless you absolutely
have to (if your logic is frame-based, etc). I would suggest the nested clip
and/or use MovieClipLoader to handle your image loading.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of john
robinson
Sent: Friday, April 06, 2007 11:48 AM
To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] attaching an event to a movie clip

You have 2 choices so far... you can set up a poll (using onEnterFrame) 
to figure out when the images have finished loading and then attach the 
events or you can do as David suggested and nest your images inside 
another clip. I don't really know if either solution is better than the 
other, but with the code you already have and what David suggested you 
can make a few changes and probably get by. Some code:


var models = new Array();

models = [ model1, model2, model3, model4];

trace(models.length);
for (i=0; imodels.length; i++){
movieName=models[i];
var newMC= this.container1.createEmptyMovieClip(movieName, 0+i);

// create another mc inside newMC to load your images into
var img_mc = newMC.createEmptyMovieClip(image_mc, 1);
// load your image
img_mc.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.onRollOver= function(){
trace(hello);
}

}


Hope it helps. Keep in mind that this doesn't let you adjust the size 
of the image. For that you'll have to go the other route and wait until 
the image has fully loaded. You could do that using the code above, but 
attach an onEnterFrame to your newMC... like so:


newMC.onEnterFrame = function() {
var bl = img_mc.getBytesLoaded();
var bt = img_mc.getBytesTotal();
if(bl == bt  bt  0) {
delete this.onEnterFrame;
// your image is now loaded... do whatever you want here.
}
}


John




On Apr 6, 2007, at 2:25 PM, Gustavo Duenas wrote:

 I did, but it is the same...nothing so far...I guess that one of you 
 maybe have been in this problem before...so I'd like to know how can I 
 finish it.


 Regards


 Gustavo
 On Apr 6, 2007, at 2:04 PM, Rost, Andrew wrote:

 newMC.rollOver

 Should be:

 newMC.onRollOver

 HTH

 -Original Message-
 From: Gustavo Duenas [mailto:[EMAIL PROTECTED]
 Sent: Friday, April 06, 2007 12:43 PM
 To: Flashcoders@chattyfig.figleaf.com
 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; imodels.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

 ___
 Flashcoders@chattyfig.figleaf.com
 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
 ___
 Flashcoders@chattyfig.figleaf.com
 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


 ___
 Flashcoders@chattyfig.figleaf.com
 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


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo

Re: [Flashcoders] attaching an event to a movie clip

2007-04-06 Thread john robinson

What do you have against onEnterFrame?

I think when you're loading into mc's it makes sense to use it simply 
because with setInterval, there's a chance that the image will be fully 
loaded (bl==bt), but it fires one frame before the mc's onLoad has 
fired, meaning your onRollOver or whatever still won't stick. Maybe I'm 
wrong and just being paranoid?


john


On Apr 6, 2007, at 3:30 PM, David Ngo wrote:

Personally, I find onEnterFrames bad practice to use unless you 
absolutely
have to (if your logic is frame-based, etc). I would suggest the 
nested clip

and/or use MovieClipLoader to handle your image loading.



___
Flashcoders@chattyfig.figleaf.com
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


RE: [Flashcoders] attaching an event to a movie clip

2007-04-06 Thread Jesse Graupmann
Or you can use the MovieClipLoader()...




//
//  DATA
//


imageData =
{
dir: models/,
ext: .jpg,
images: [
 {title:'myfirst', path:image1}, 
 {title:'mysecond', path:image2}
 ],
clips: []
};

//
//  CREATE
//

var xspace = 100;
var yspace = 100;
var holder = this.createEmptyMovieClip ( 'holder',
this.getNextHighestDepth();
var len = imageData.images.length;

for (i = 0; i  len; i++)
{
var mc = holder.createEmptyMovieClip ( 'mc_'+ i,
holder.getNextHighestDepth() )
mc.image = mc.createEmptyMovieClip ( 'image',
mc.getNextHighestDepth() )

mc.loader = new MovieClipLoader();
mc.loader.addListener( mc );
mc.onLoadInit = proxyBEFORE ( this, image_onLoadInit, i );
mc.onLoadError = proxyBEFORE ( this, image_onLoadError, i );
mc.loader.loadClip( imageData.dir + imageData.images[i].path +
imageData.ext, mc.image );

mc.id = i;
mc._x= xspace * -i;
mc._y = yspace * i;

imageData.clips.push ( mc );
}

//
//  LOADING
//

function image_onLoadError ( id, image )
{
var mc = imageData.clips [ id ];
trace( 'image not loaded for: ' + mc );
}

function image_onLoadInit ( id, image )
{
var mc = imageData.clips [ id ];

delete mc.loader;
delete mc.onLoadInit;

mc.onRollOver = function()
{
var title = imageData.images [ id ].title;
var path = imageData.images [ id ].path;

trace( 'title: ' + title +  '  path: ' + path )
}
}


//
//  PROXY
//

function proxyBEFORE (s:Object, func:Function):Function
{
// from jgDelegate
var a:Array = arguments.slice(2, arguments.length);
return function ():Void { func.apply(s, a.concat(arguments));};
}






_

Jesse Graupmann
www.jessegraupmann.com  
www.justgooddesign.com/blog/   
_




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of David Ngo
Sent: Friday, April 06, 2007 12:30 PM
To: flashcoders@chattyfig.figleaf.com
Subject: RE: [Flashcoders] attaching an event to a movie clip

Personally, I find onEnterFrames bad practice to use unless you absolutely
have to (if your logic is frame-based, etc). I would suggest the nested clip
and/or use MovieClipLoader to handle your image loading.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of john
robinson
Sent: Friday, April 06, 2007 11:48 AM
To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] attaching an event to a movie clip

You have 2 choices so far... you can set up a poll (using onEnterFrame) 
to figure out when the images have finished loading and then attach the 
events or you can do as David suggested and nest your images inside 
another clip. I don't really know if either solution is better than the 
other, but with the code you already have and what David suggested you 
can make a few changes and probably get by. Some code:


var models = new Array();

models = [ model1, model2, model3, model4];

trace(models.length);
for (i=0; imodels.length; i++){
movieName=models[i];
var newMC= this.container1.createEmptyMovieClip(movieName, 0+i);

// create another mc inside newMC to load your images into
var img_mc = newMC.createEmptyMovieClip(image_mc, 1);
// load your image
img_mc.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.onRollOver= function(){
trace(hello);
}

}


Hope it helps. Keep in mind that this doesn't let you adjust the size 
of the image. For that you'll have to go the other route and wait until 
the image has fully loaded. You could do that using the code above, but 
attach an onEnterFrame to your newMC... like so:


newMC.onEnterFrame = function() {
var bl = img_mc.getBytesLoaded();
var bt = img_mc.getBytesTotal();
if(bl == bt  bt  0) {
delete this.onEnterFrame;
// your image is now loaded... do whatever you want here.
}
}


John




On Apr 6, 2007, at 2:25 PM, Gustavo Duenas wrote:

 I did, but it is the same...nothing so far...I guess that one of you 
 maybe have been in this problem before...so I'd like to know how can I 
 finish it.


 Regards


 Gustavo
 On Apr 6, 2007, at 2:04 PM, Rost, Andrew wrote

Re: [Flashcoders] attaching an event to a movie clip

2007-04-06 Thread Muzak
I don't know what's going on with the list (and the kind of replies) lately.
Quick hacks are just what they are, quick hacks.. avoid them..

As David pointed out, dump and forget about loadMovie (there's no loadMovie in 
AS3 anyways).
Use the MovieClipLoader class to load external assets (replaced with 
flash.display.Loader in AS3)

It's much more elegant and has methods and events to handle loading of external 
assets.

As for the reason why your events attached to the movieclip don't work, that's 
because when loading something in a MovieClip, 
everything associated with that MovieClip is cleared/removed.
So you'll have to wait for the external asset to be fully loaded before 
assigning events to the MovieClip and that's what the 
MovieClipLoader is for. The onLoadInit event will tell you when the MovieClip 
is ready to work with and is when you can assign 
events to it.

regards,
Muzak.

- Original Message - 
From: David Ngo [EMAIL PROTECTED]
To: flashcoders@chattyfig.figleaf.com
Sent: Friday, April 06, 2007 9:30 PM
Subject: RE: [Flashcoders] attaching an event to a movie clip


 Personally, I find onEnterFrames bad practice to use unless you absolutely
 have to (if your logic is frame-based, etc). I would suggest the nested clip
 and/or use MovieClipLoader to handle your image loading.




___
Flashcoders@chattyfig.figleaf.com
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


Re: [Flashcoders] attaching an event to a movie clip

2007-04-06 Thread Gustavo Duenas
thanks for all guys I'm gonna run the codes to see which one fits me  
better.


Regards

Gustavo Duenas

Ps: I'm using AS2
On Apr 6, 2007, at 5:45 PM, Muzak wrote:

I don't know what's going on with the list (and the kind of  
replies) lately.

Quick hacks are just what they are, quick hacks.. avoid them..

As David pointed out, dump and forget about loadMovie (there's no  
loadMovie in AS3 anyways).
Use the MovieClipLoader class to load external assets (replaced  
with flash.display.Loader in AS3)


It's much more elegant and has methods and events to handle loading  
of external assets.


As for the reason why your events attached to the movieclip don't  
work, that's because when loading something in a MovieClip,

everything associated with that MovieClip is cleared/removed.
So you'll have to wait for the external asset to be fully loaded  
before assigning events to the MovieClip and that's what the
MovieClipLoader is for. The onLoadInit event will tell you when the  
MovieClip is ready to work with and is when you can assign

events to it.

regards,
Muzak.

- Original Message -
From: David Ngo [EMAIL PROTECTED]
To: flashcoders@chattyfig.figleaf.com
Sent: Friday, April 06, 2007 9:30 PM
Subject: RE: [Flashcoders] attaching an event to a movie clip


Personally, I find onEnterFrames bad practice to use unless you  
absolutely
have to (if your logic is frame-based, etc). I would suggest the  
nested clip

and/or use MovieClipLoader to handle your image loading.





___
Flashcoders@chattyfig.figleaf.com
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



___
Flashcoders@chattyfig.figleaf.com
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