thanks jason. I'll do that.
any good (easy to understand) oop book out there?

----- Original Message ----- From: "Merrill, Jason" <[email protected]>
To: "Flash Coders List" <[email protected]>
Sent: Thursday, September 09, 2010 7:55 PM
Subject: RE: [Flashcoders] access a mc in stage from a class


Forget the timeline. Associate each of your movieclips in your library with a corresponding class that extends Sprite or MovieClip. Then instantiate and add each as children to your document class. I won't go into design patterns like MVC and how you would do that, but this would be a basic setup and allow you total control over all instances.


Jason Merrill

Instructional Technology Architect
Bank of America   Global Learning

Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog
(Note: these resources are only available for Bank of America associates)






-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Rodrigo Augusto Guerra
Sent: Thursday, September 09, 2010 6:44 PM
To: Flash Coders List
Subject: Re: [Flashcoders] access a mc in stage from a class

the first version I tried to do was like you mentioned. but had the first problem (access the mc on stage) and swiched to the document class..

the project is a recorder, so I did 3 classes, connection, mic and recorder.

in the main timeline I import all the 3 classes then I create a instance of each (timeline code not document class). the problem start here because i want a mic and recorder instance ONLY if the connection class could connect. that is different from :

//this will ceatae them all at once without care about connection ok or no..
mymic:CustomMic = new CustomMic()
myconn:CustomConn = new CustomConn()
myRecorder:CustomRec = new CustomRec()

how can I have something like listening for the connection class event "NetConnection.Connect.Success" and then this "something" would create the mic and the recorder instances.

I can not tie any creation of new instances of the recorder and mic class to the "NetConnection.Connect.Success" because this conn class will be used in other projects and it's not always that i would need them.

thanks,
rodrigo.

----- Original Message -----
From: "Merrill, Jason" <[email protected]>
To: "Flash Coders List" <[email protected]>
Sent: Thursday, September 09, 2010 3:49 PM
Subject: RE: [Flashcoders] access a mc in stage from a class


Not to the constructor of a document class, but you should think about
what you're trying to accomplish.  I would recommend if you're moving to
AS3 classes, you break this project into varying classes that are
instantiated from the document class.   You can of course send arguments
to the constructors of other classes.  I wouldn't recommend mixing
timeline code and external classes.

Jason Merrill

Instructional Technology Architect
Bank of America   Global Learning

Join the Bank of America Flash Platform Community  and visit our
Instructional Technology Design Blog
(Note: these resources are only available for Bank of America associates)






-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Rodrigo
Augusto Guerra
Sent: Thursday, September 09, 2010 2:43 PM
To: 'Flash Coders List'
Subject: Re: [Flashcoders] access a mc in stage from a class

cor, jason.

that did the trick  thanks.... and led to a new problem.
declaring as a class document makes the contructor rum automatically when
the movie loads correct?
can I pass some parameters to the document class constructor?



----- Original Message ----- From: "Cor" <[email protected]>
To: "'Rodrigo Augusto Guerra'" <[email protected]>; "'Flash Coders
List'" <[email protected]>
Sent: Thursday, September 09, 2010 1:25 PM
Subject: RE: [Flashcoders] access a mc in stage from a class


Did you set this one Class as Document Class in the properties panel?

Groeten,
Cor van Dooren

------------------------------------------------------------------
"There are only 10 types of people in the world:
  Those who understand binary and those who don't."

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Rodrigo
Augusto Guerra
Sent: donderdag 9 september 2010 18:18
To: Flash Coders List
Subject: [Flashcoders] access a mc in stage from a class

hi,

i'm trying to migrate from as2... and I need to access a mc named mc1 that is on stage. no class associated with this mc, only 1 class for the entire
movie.

I have the following class:

package
{

import flash.display.*;
import flash.events.*;


public class foo
{


//constructor
 public function foo():void
 {
   trace("hi")
      mc1.x+=30;   <- don't work.
 }
}


how can I inform the class that I have a mc (mc1) in the stage in order to
access i´'s properties and methods? tried with addChild too but had no
luck.

thanks,
rodrigo.
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Geen virus gevonden in het binnenkomende-bericht.
Gecontroleerd door AVG - www.avg.com
Versie: 9.0.851 / Virusdatabase: 271.1.1/3123 - datum van uitgifte:
09/08/10
19:41:00



_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to