Re: [Flashcoders] Controlling a swf loaded into a movieclip

2006-09-29 Thread Kjel Anderson
Marcelo,

I want to make sure that I understand what you are saying. When a swf created 
with MTASC is loaded into an swf created within the flash environment, it is 
not possible to reference functions from the IDE created swf from within the 
MTASC created swf. In short, there is no possibility of communication?

Thank you for your patience,

Kjel

On Friday 29 September 2006 1:23 pm, Marcelo de Moraes Serpa wrote:
> Kjel: Indeed, it can be confusing at beginning to creat this Flash IDE <->
> MTASC integration mindset. But it's really quite simple, with mtasc you can
> really only inject as2 classes into Flash IDE pre-compiled swf's.
>
> >I have a MVC framework for the application, but I am not sure how to add a
> >listener if I can't resolve the scope
>
> You need some kind of global proxy such as the Davies Grant
> SystemController for ARP (singleton), that's how I implemented this on my
> last project.
>
> However, I would really recommend you to take a look at PIXLIB. It has a
> great (if not the best) MVC approach for Flash 8< development. I'm sure you
> could easilly implement this with the ViewHelper class and still mainain
> the flexibility and scalability while adopting a good OOP MVC paradigm.
> Join the pixlib list and give it a try :)
>
> Marcelo.
>
> On 9/29/06, Muzak <[EMAIL PROTECTED]> wrote:
> > Yeah, alot of people seem to be confused about onLoadComplete and
> > onLoadInit.
> > If it was up to me, I'd just dump onLoadComplete :-)
> >
> > If you listen for both events, you'll notice onLoadComplete is triggered
> > before onLoadInit.
> > In short, forget about onLoadComplete and always use onLoadInit.
> >
> > Muzak
> >
> > - Original Message -----
> > From: "Glen Pike" <[EMAIL PROTECTED]>
> > To: "Flashcoders mailing list" 
> > Sent: Friday, September 29, 2006 1:47 PM
> > Subject: Re: [Flashcoders] Controlling a swf loaded into a movieclip
> >
> > > Aha,
> > >
> > >No, I had misinterpreted this as being called when the MovieClip
> >
> > loader initialised and was removing the MCL Listener when the
> >
> > > onLoadComplete function was called so I never saw any debug
> >
> > trace.  (...Reads documentation...) :-[
> >
> > >   That makes it a lot simpler - Doh! (It is alright to say Doh! isn't
> >
> > it?)
> >
> > >Cheers
> > >
> > > Glen
> > >
> > > Muzak wrote:
> > >> Are you using MovieClipLoader.onLoadInit()?
> > >>
> > >> Muzak
> >
> > ___
> > [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


Re: [Flashcoders] Controlling a swf loaded into a movieclip

2006-09-29 Thread Marcelo de Moraes Serpa

Kjel: Indeed, it can be confusing at beginning to creat this Flash IDE <->
MTASC integration mindset. But it's really quite simple, with mtasc you can
really only inject as2 classes into Flash IDE pre-compiled swf's.


I have a MVC framework for the application, but I am not sure how to add a
listener if I can't resolve the scope


You need some kind of global proxy such as the Davies Grant SystemController
for ARP (singleton), that's how I implemented this on my last project.

However, I would really recommend you to take a look at PIXLIB. It has a
great (if not the best) MVC approach for Flash 8< development. I'm sure you
could easilly implement this with the ViewHelper class and still mainain the
flexibility and scalability while adopting a good OOP MVC paradigm. Join the
pixlib list and give it a try :)

Marcelo.




On 9/29/06, Muzak <[EMAIL PROTECTED]> wrote:


Yeah, alot of people seem to be confused about onLoadComplete and
onLoadInit.
If it was up to me, I'd just dump onLoadComplete :-)

If you listen for both events, you'll notice onLoadComplete is triggered
before onLoadInit.
In short, forget about onLoadComplete and always use onLoadInit.

Muzak

- Original Message -
From: "Glen Pike" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" 
Sent: Friday, September 29, 2006 1:47 PM
Subject: Re: [Flashcoders] Controlling a swf loaded into a movieclip


> Aha,
>
>No, I had misinterpreted this as being called when the MovieClip
loader initialised and was removing the MCL Listener when the
> onLoadComplete function was called so I never saw any debug
trace.  (...Reads documentation...) :-[
>   That makes it a lot simpler - Doh! (It is alright to say Doh! isn't
it?)
>
>Cheers
>
> Glen
>
> Muzak wrote:
>> Are you using MovieClipLoader.onLoadInit()?
>>
>> Muzak
>>


___
[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


Re: [Flashcoders] Controlling a swf loaded into a movieclip

2006-09-29 Thread Muzak
Yeah, alot of people seem to be confused about onLoadComplete and onLoadInit.
If it was up to me, I'd just dump onLoadComplete :-)

If you listen for both events, you'll notice onLoadComplete is triggered before 
onLoadInit.
In short, forget about onLoadComplete and always use onLoadInit.

Muzak

- Original Message - 
From: "Glen Pike" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" 
Sent: Friday, September 29, 2006 1:47 PM
Subject: Re: [Flashcoders] Controlling a swf loaded into a movieclip


> Aha,
>
>No, I had misinterpreted this as being called when the MovieClip loader 
> initialised and was removing the MCL Listener when the 
> onLoadComplete function was called so I never saw any debug trace.  (...Reads 
> documentation...) :-[
>   That makes it a lot simpler - Doh! (It is alright to say Doh! isn't it?)
>
>Cheers
>
> Glen
>
> Muzak wrote:
>> Are you using MovieClipLoader.onLoadInit()?
>>
>> Muzak
>>


___
[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


Re: [Flashcoders] Controlling a swf loaded into a movieclip

2006-09-29 Thread Kjel Anderson
Marcelo,

I have a MVC framework for the application, but I am not sure how to add a 
listener if I can't resolve the scope. I need to find a good tutorial about 
combining stuff from the IDE with stuff written entirely in mtasc. I have 
been writing pure actionscript, but I am just getting started with the IDE. 
Do you know of anything like that?

Thanks,

Kjel

On Friday 29 September 2006 11:12 am, Marcelo de Moraes Serpa wrote:
> I don't usually call methods directly on loaded SWF's. Try decoupling it
> more by creating some kind of interface or by dispatching events. Maybe you
> could make use of a MVC framework such as pixlib (the best for flash at the
> moment), this would make your app much more maintanable, flexible and
> scalable.
>
> On 9/29/06, Kjel Anderson <[EMAIL PROTECTED]> wrote:
> > This discussion seems pretty informative, but unfortunately, much of it
> > is over my head. I'm having trouble resolving scope. I can iterate
> > through the
> > movieclips in my loaded swf, but I don't seem to be able to call
> > properties
> > or methods. Can someone point me in the right direction on this?
> >
> > Thanks,
> >
> > Kjel
> >
> > On Friday 29 September 2006 7:47 am, Glen Pike wrote:
> > > Aha,
> > >
> > > No, I had misinterpreted this as being called when the MovieClip
> > > loader initialised and was removing the MCL Listener when the
> > > onLoadComplete function was called so I never saw any debug trace.
> > > (...Reads documentation...) :-[
> > >
> > > That makes it a lot simpler - Doh! (It is alright to say Doh! isn't
> > > it?)
> > >
> > > Cheers
> > >
> > > Glen
> > >
> > > Muzak wrote:
> > > > Are you using MovieClipLoader.onLoadInit()?
> > > >
> > > > Muzak
> > > >
> > > > - Original Message -
> > > > From: "Glen Pike" <[EMAIL PROTECTED]>
> > > > To: "Flashcoders mailing list" 
> > > > Sent: Thursday, September 28, 2006 11:40 PM
> > > > Subject: Re: [Flashcoders] Controlling a swf loaded into a movieclip
> > > >
> > > >> Hi,
> > > >>   I have been doing something similar with a site that I am
> > > >> building. There is a "shell" application that loads up various swfs
> > > >> into a
> >
> > holder
> >
> > > >> clip.  The application needs to be able to talk to these loaded
> > > >> clips and do stuff to them.  The way I have worked it is to load up
> > > >> a SWF which has a movieclip on stage linked to a "Page" class.  When
> > > >> the
> >
> > page
> >
> > > >> class is ready (see the setInterval call) it will call a function on
> >
> > the
> >
> > > >> parent movie clip called "registerPage" at that point the parent
> >
> > movie
> >
> > > >> clip ("ApplicationForm") can start calling methods on the class.  I
> >
> > am
> >
> > > >> not sure if there is a better way of doing this, but I have found
> >
> > that
> >
> > > >> loaded clips seem to take a few milliseconds to actually initialise
> > > >> properly so that I can actually call my own methods on them - hence
> > > >> putting in the waitOnLoad function.  If anyone knows how to do this
> >
> > in
> >
> > > >> an easier way, please tell me.
> > > >>
> > > >> Thanks
> > > >>
> > > >> Glen
> > > >
> > > > ___
> > > > [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

Re: [Flashcoders] Controlling a swf loaded into a movieclip

2006-09-29 Thread Marcelo de Moraes Serpa

I don't usually call methods directly on loaded SWF's. Try decoupling it
more by creating some kind of interface or by dispatching events. Maybe you
could make use of a MVC framework such as pixlib (the best for flash at the
moment), this would make your app much more maintanable, flexible and
scalable.

On 9/29/06, Kjel Anderson <[EMAIL PROTECTED]> wrote:


This discussion seems pretty informative, but unfortunately, much of it is
over my head. I'm having trouble resolving scope. I can iterate through
the
movieclips in my loaded swf, but I don't seem to be able to call
properties
or methods. Can someone point me in the right direction on this?

Thanks,

Kjel

On Friday 29 September 2006 7:47 am, Glen Pike wrote:
> Aha,
>
> No, I had misinterpreted this as being called when the MovieClip
> loader initialised and was removing the MCL Listener when the
> onLoadComplete function was called so I never saw any debug trace.
> (...Reads documentation...) :-[
>
> That makes it a lot simpler - Doh! (It is alright to say Doh! isn't
> it?)
>
> Cheers
>
> Glen
>
> Muzak wrote:
> > Are you using MovieClipLoader.onLoadInit()?
> >
> > Muzak
> >
> > - Original Message -
> > From: "Glen Pike" <[EMAIL PROTECTED]>
> > To: "Flashcoders mailing list" 
> > Sent: Thursday, September 28, 2006 11:40 PM
> > Subject: Re: [Flashcoders] Controlling a swf loaded into a movieclip
> >
> >> Hi,
> >>   I have been doing something similar with a site that I am building.
> >> There is a "shell" application that loads up various swfs into a
holder
> >> clip.  The application needs to be able to talk to these loaded clips
> >> and do stuff to them.  The way I have worked it is to load up a SWF
> >> which has a movieclip on stage linked to a "Page" class.  When the
page
> >> class is ready (see the setInterval call) it will call a function on
the
> >> parent movie clip called "registerPage" at that point the parent
movie
> >> clip ("ApplicationForm") can start calling methods on the class.  I
am
> >> not sure if there is a better way of doing this, but I have found
that
> >> loaded clips seem to take a few milliseconds to actually initialise
> >> properly so that I can actually call my own methods on them - hence
> >> putting in the waitOnLoad function.  If anyone knows how to do this
in
> >> an easier way, please tell me.
> >>
> >> Thanks
> >>
> >> Glen
> >
> > ___
> > [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


Re: [Flashcoders] Controlling a swf loaded into a movieclip

2006-09-29 Thread Kjel Anderson
This discussion seems pretty informative, but unfortunately, much of it is 
over my head. I'm having trouble resolving scope. I can iterate through the 
movieclips in my loaded swf, but I don't seem to be able to call properties 
or methods. Can someone point me in the right direction on this?

Thanks,

Kjel

On Friday 29 September 2006 7:47 am, Glen Pike wrote:
> Aha,
>
> No, I had misinterpreted this as being called when the MovieClip
> loader initialised and was removing the MCL Listener when the
> onLoadComplete function was called so I never saw any debug trace.
> (...Reads documentation...) :-[
>
> That makes it a lot simpler - Doh! (It is alright to say Doh! isn't
> it?)
>
> Cheers
>
> Glen
>
> Muzak wrote:
> > Are you using MovieClipLoader.onLoadInit()?
> >
> > Muzak
> >
> > - Original Message -
> > From: "Glen Pike" <[EMAIL PROTECTED]>
> > To: "Flashcoders mailing list" 
> > Sent: Thursday, September 28, 2006 11:40 PM
> > Subject: Re: [Flashcoders] Controlling a swf loaded into a movieclip
> >
> >> Hi,
> >>   I have been doing something similar with a site that I am building. 
> >> There is a "shell" application that loads up various swfs into a holder
> >> clip.  The application needs to be able to talk to these loaded clips
> >> and do stuff to them.  The way I have worked it is to load up a SWF
> >> which has a movieclip on stage linked to a "Page" class.  When the page
> >> class is ready (see the setInterval call) it will call a function on the
> >> parent movie clip called "registerPage" at that point the parent movie
> >> clip ("ApplicationForm") can start calling methods on the class.  I am
> >> not sure if there is a better way of doing this, but I have found that
> >> loaded clips seem to take a few milliseconds to actually initialise
> >> properly so that I can actually call my own methods on them - hence
> >> putting in the waitOnLoad function.  If anyone knows how to do this in
> >> an easier way, please tell me.
> >>
> >> Thanks
> >>
> >> Glen
> >
> > ___
> > [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


Re: [Flashcoders] Controlling a swf loaded into a movieclip

2006-09-29 Thread Glen Pike

Aha,

   No, I had misinterpreted this as being called when the MovieClip 
loader initialised and was removing the MCL Listener when the 
onLoadComplete function was called so I never saw any debug trace.  
(...Reads documentation...) :-[
  
   That makes it a lot simpler - Doh! (It is alright to say Doh! isn't it?)


   Cheers

Glen

Muzak wrote:

Are you using MovieClipLoader.onLoadInit()?

Muzak

- Original Message - 
From: "Glen Pike" <[EMAIL PROTECTED]>

To: "Flashcoders mailing list" 
Sent: Thursday, September 28, 2006 11:40 PM
Subject: Re: [Flashcoders] Controlling a swf loaded into a movieclip


  

Hi,
  I have been doing something similar with a site that I am building.  There is a "shell" application that loads up various swfs 
into a holder clip.  The application needs to be able to talk to these loaded clips and do stuff to them.  The way I have worked 
it is to load up a SWF which has a movieclip on stage linked to a "Page" class.  When the page class is ready (see the setInterval 
call) it will call a function on the parent movie clip called "registerPage" at that point the parent movie clip 
("ApplicationForm") can start calling methods on the class.  I am not sure if there is a better way of doing this, but I have 
found that loaded clips seem to take a few milliseconds to actually initialise properly so that I can actually call my own methods 
on them - hence putting in the waitOnLoad function.  If anyone knows how to do this in an easier way, please tell me.


Thanks

Glen




___
[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


Re: [Flashcoders] Controlling a swf loaded into a movieclip

2006-09-28 Thread Reuben Stanton
I have always used MovieClipLoader for this and it seems to work fine  
- OnLoadInit() will run after the first frame has initialised.


On 29/09/2006, at 12:24 PM, Muzak wrote:


Are you using MovieClipLoader.onLoadInit()?

Muzak

- Original Message -
From: "Glen Pike" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" 
Sent: Thursday, September 28, 2006 11:40 PM
Subject: Re: [Flashcoders] Controlling a swf loaded into a movieclip



Hi,
  I have been doing something similar with a site that I am  
building.  There is a "shell" application that loads up various swfs
into a holder clip.  The application needs to be able to talk to  
these loaded clips and do stuff to them.  The way I have worked
it is to load up a SWF which has a movieclip on stage linked to a  
"Page" class.  When the page class is ready (see the setInterval
call) it will call a function on the parent movie clip called  
"registerPage" at that point the parent movie clip
("ApplicationForm") can start calling methods on the class.  I am  
not sure if there is a better way of doing this, but I have
found that loaded clips seem to take a few milliseconds to  
actually initialise properly so that I can actually call my own  
methods
on them - hence putting in the waitOnLoad function.  If anyone  
knows how to do this in an easier way, please tell me.


Thanks

Glen



___
[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


Re: [Flashcoders] Controlling a swf loaded into a movieclip

2006-09-28 Thread Muzak
Are you using MovieClipLoader.onLoadInit()?

Muzak

- Original Message - 
From: "Glen Pike" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" 
Sent: Thursday, September 28, 2006 11:40 PM
Subject: Re: [Flashcoders] Controlling a swf loaded into a movieclip


> Hi,
>   I have been doing something similar with a site that I am building.  There 
> is a "shell" application that loads up various swfs 
> into a holder clip.  The application needs to be able to talk to these loaded 
> clips and do stuff to them.  The way I have worked 
> it is to load up a SWF which has a movieclip on stage linked to a "Page" 
> class.  When the page class is ready (see the setInterval 
> call) it will call a function on the parent movie clip called "registerPage" 
> at that point the parent movie clip 
> ("ApplicationForm") can start calling methods on the class.  I am not sure if 
> there is a better way of doing this, but I have 
> found that loaded clips seem to take a few milliseconds to actually 
> initialise properly so that I can actually call my own methods 
> on them - hence putting in the waitOnLoad function.  If anyone knows how to 
> do this in an easier way, please tell me.
>
> Thanks
>
> Glen


___
[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


RE: [Flashcoders] Controlling a swf loaded into a movieclip

2006-09-28 Thread Steven Sacks | BLITZ
I use something along these lines:

fCount = 0;
this.onEnterFrame = function() {
fCount++;
if (fCount > 0) {
delete this.onEnterFrame;
callMethodsOnTargetClip();
}
}

;)

___
[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


Re: [Flashcoders] Controlling a swf loaded into a movieclip

2006-09-28 Thread Glen Pike

Thanks for that.

Is my workaround a standard thing or a dodgy hack??

Steven Sacks | BLITZ wrote:

but I have found that
loaded clips seem to take a few milliseconds to actually initialise
properly so that I can actually call my own methods on them 



What you're describing is clips need one frame to draw before you can
call their methods (though you can set properties before the frame
passes).  This is something that has been in Flash since the beginning.


___
[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


RE: [Flashcoders] Controlling a swf loaded into a movieclip

2006-09-28 Thread Steven Sacks | BLITZ
> but I have found that
> loaded clips seem to take a few milliseconds to actually initialise
> properly so that I can actually call my own methods on them 

What you're describing is clips need one frame to draw before you can
call their methods (though you can set properties before the frame
passes).  This is something that has been in Flash since the beginning.


___
[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


Re: [Flashcoders] Controlling a swf loaded into a movieclip

2006-09-28 Thread Glen Pike

Hi,
  
   I have been doing something similar with a site that I am building.  
There is a "shell" application that loads up various swfs into a holder 
clip.  The application needs to be able to talk to these loaded clips 
and do stuff to them.  The way I have worked it is to load up a SWF 
which has a movieclip on stage linked to a "Page" class.  When the page 
class is ready (see the setInterval call) it will call a function on the 
parent movie clip called "registerPage" at that point the parent movie 
clip ("ApplicationForm") can start calling methods on the class.  I am 
not sure if there is a better way of doing this, but I have found that 
loaded clips seem to take a few milliseconds to actually initialise 
properly so that I can actually call my own methods on them - hence 
putting in the waitOnLoad function.  If anyone knows how to do this in 
an easier way, please tell me.


Thanks

Glen

See stripped down code:

//ApplicationForm class
import org.osflash.arp.log.Log;
import mx.utils.Delegate;
/**
* ApplicationForm class
* This is the meat of our website and deals with loading pages in
* response to events that come from a menu - @see MenuForm implements
* the functionality to deal with this.
*/
class ApplicationForm extends EventDispatcherForm //implements the 
EventDispatcher mixin

{
   //
   // Group: On Stage
   //
   private var mPageHolder:MovieClip;
   //
   // Group: Properties
   //
   //Handle loading of external resources.
   private var mLoader:MovieClipLoader;
   private var mLoading:Boolean;
  
   //Keep track of the page we are on - so we can call functions on it.

   private var mCurrentPage:Page;
  
   private var mSwfToLoad:String;
  
  
   function ApplicationForm ()

   {
   stop();
   }
  
   /**

   * registerPage is called by a "Page" child movie clip when it is loaded
   * this means that the class linked to the clip will have been fully 
defined

   * and can have methods called on it.
   * @parampPage reference to a Page movieclip that has been loaded 
into

   * the "PageHolder" from an external SWF.
   */
   public function registerPage(pPage:Page):Void {
   Log.debug("ApplicationForm::registerPage " + pPage);
   //trace("registerPage " + pPage);
   mCurrentPage = pPage;
   mCurrentPage.addEventListener("pagevis", Delegate.create(this, 
pageVisibility));

   mCurrentPage.show();
   }
  
   /**
   * onLoad - we do our initialisation in here rather than in the 
constructor because
   * any clips on stage will be initialised too - make sure the "load 
order" for the

   * FLA is "Bottom Up" otherwise this is not true.
   */
   function onLoad ()
   {
   // Initialize the LuminicBox Logger
   Log.initialize();
  
   // Note: This handler is used to initialize the application state.
   Log.warn ("ApplicationForm::onLoad - Application initialization 
started!");
  
   mLoader = new MovieClipLoader();


  //etc
   }
  
   /**

   * EventHandler for a "pagevis" event dispatched by a Page class - this
   * means it has either done it's intro animations and is ready to do 
stuff or

   * has done it's exit animations and is actually hidden.
   * If it is hidden - we are waiting to load a new page.  If it is 
visible, we change

   * the flag to say we are allowed to load a different page.
   * @paramevt
   */
   private function pageVisibility(evt:Object):Void {
   Log.it("ApplicationForm::pageVisibility " + evt.target + ", " + 
evt.visibility);
  
   if(false == evt.visibility) {

   //page is "hidden", load the next
   _loadSwf(mSwfToLoad);
   } else {
   //tell everyone we have finished loading..
   loading = false;
   }
   }
  
   /**

   * Call to start loading an external SWF into the "PageHolder" clip.
   * @paramswfName
   */
   private function _loadSwf(swfName:String) {
   Log.it("ApplicationForm::Loading swf " + swfName + " into " + 
mPageHolder);

   loading = true;
   mLoader.addListener(this);
   mLoaderForm.percent = 0.0;
   mLoaderForm.visible = true;
   mLoader.loadClip(swfName, mPageHolder);
   }
  
   /**

*Implement Listener functions for the MovieClipLoader object.
*/
   //etc...
}


/**
* Page class is a movieclip that is loaded into the ApplicationForm from
* an external SWF.
*/
import org.osflash.arp.log.Log;

class Page extends EventDispatcherForm
{

   //
   // Group: Properties
   //
   private var mWaitInterval:Number;
  
   function Page ()

   {
   stop();
   }
  
   /**

   * Accessor for the _visible parameter
   * @paramvis
   */
   public function set visible(vis:Boolean):Void {
   _visible = vis;
   }
  
   public function get visible():Boolean { return _visible; }
  
   /**
   * Called by the parent movie clip to "show" this one - starts off a 
Tweening

   * process - sort of an intro.
   * @paramevt
   */
   public function show(evt:Object) {
   Log.

RE: [Flashcoders] Controlling a swf loaded into a movieclip

2006-09-28 Thread Merrill, Jason
How are you showing and hiding it?  _visible or moving it elsewhere, or
destroying the movie clip that holds it and re-loading again?  

Jason Merrill
Bank of America 
Learning & Organization Effectiveness - Technology Solutions 
 
 
 
 
 

>>-Original Message-
>>From: [EMAIL PROTECTED] [mailto:flashcoders-
>>[EMAIL PROTECTED] On Behalf Of Kjel Anderson
>>Sent: Thursday, September 28, 2006 4:58 PM
>>To: Flashcoders mailing list
>>Subject: Re: [Flashcoders] Controlling a swf loaded into a movieclip
>>
>>That is what I am having a hard time figuring that out. I am using a
mask to
>>show/hide the loaded movie. I can hide it, but when I show it again,
there is
>>nothing there. I can't really figure out what is going on. My goal is
to be
>>able to reference the properties and methods of the application
context (I
>>don't know if that is possible). I am able to iterate through the
movieclips.
>>I'd like to keep that instance running, even when it is not visible.
Do you
>>have any idea where to start with something like this?
>>
>>Thanks,
>>
>>Kjel
>>
>>On Thursday 28 September 2006 4:45 pm, Merrill, Jason wrote:
>>> What in the loaded .swf are you trying to pause?  It's root
timeline?
>>> If so, it would just be theLoadedSwfInstance.stop();
>>>
>>>
>>>
>>> Jason Merrill
>>> Bank of America
>>> Learning & Organization Effectiveness - Technology Solutions
>>>
>>> >>-Original Message-
>>> >>From: [EMAIL PROTECTED]
[mailto:flashcoders-
>>> >>[EMAIL PROTECTED] On Behalf Of Kjel Anderson
>>> >>Sent: Thursday, September 28, 2006 3:55 PM
>>> >>To: 'Flashcoders mailing list'
>>> >>Subject: [Flashcoders] Controlling a swf loaded into a movieclip
>>> >>
>>> >>Hey everyone,
>>> >>
>>> >>I have an application that was developed in 100% actionscript
(without
>>>
>>> the
>>>
>>> >>ide) and I am now trying to control it from within an application
that
>>>
>>> I
>>>
>>> >>built in the IDE. I would very much like to be able to "pause"
this
>>>
>>> swf, but
>>>
>>> >>I can't seem to figure out how to do it. Any ideas?
>>> >>
>>> >>Thanks,
>>> >>
>>> >>Kjel
>>> >>___
>>> >>[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


Re: [Flashcoders] Controlling a swf loaded into a movieclip

2006-09-28 Thread Kjel Anderson
That is what I am having a hard time figuring that out. I am using a mask to 
show/hide the loaded movie. I can hide it, but when I show it again, there is 
nothing there. I can't really figure out what is going on. My goal is to be 
able to reference the properties and methods of the application context (I 
don't know if that is possible). I am able to iterate through the movieclips. 
I'd like to keep that instance running, even when it is not visible. Do you 
have any idea where to start with something like this?

Thanks,

Kjel

On Thursday 28 September 2006 4:45 pm, Merrill, Jason wrote:
> What in the loaded .swf are you trying to pause?  It's root timeline?
> If so, it would just be theLoadedSwfInstance.stop();
>
>
>
> Jason Merrill
> Bank of America
> Learning & Organization Effectiveness - Technology Solutions
>
> >>-Original Message-
> >>From: [EMAIL PROTECTED] [mailto:flashcoders-
> >>[EMAIL PROTECTED] On Behalf Of Kjel Anderson
> >>Sent: Thursday, September 28, 2006 3:55 PM
> >>To: 'Flashcoders mailing list'
> >>Subject: [Flashcoders] Controlling a swf loaded into a movieclip
> >>
> >>Hey everyone,
> >>
> >>I have an application that was developed in 100% actionscript (without
>
> the
>
> >>ide) and I am now trying to control it from within an application that
>
> I
>
> >>built in the IDE. I would very much like to be able to "pause" this
>
> swf, but
>
> >>I can't seem to figure out how to do it. Any ideas?
> >>
> >>Thanks,
> >>
> >>Kjel
> >>___
> >>[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


RE: [Flashcoders] Controlling a swf loaded into a movieclip

2006-09-28 Thread Merrill, Jason
What in the loaded .swf are you trying to pause?  It's root timeline?
If so, it would just be theLoadedSwfInstance.stop();



Jason Merrill
Bank of America 
Learning & Organization Effectiveness - Technology Solutions 
 
 
 
 
 

>>-Original Message-
>>From: [EMAIL PROTECTED] [mailto:flashcoders-
>>[EMAIL PROTECTED] On Behalf Of Kjel Anderson
>>Sent: Thursday, September 28, 2006 3:55 PM
>>To: 'Flashcoders mailing list'
>>Subject: [Flashcoders] Controlling a swf loaded into a movieclip
>>
>>Hey everyone,
>>
>>I have an application that was developed in 100% actionscript (without
the
>>ide) and I am now trying to control it from within an application that
I
>>built in the IDE. I would very much like to be able to "pause" this
swf, but
>>I can't seem to figure out how to do it. Any ideas?
>>
>>Thanks,
>>
>>Kjel
>>___
>>[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