Re: [Flashcoders] instantiate symbol linked to parent movie's library

2009-09-22 Thread Hans Wichman
Hi,

I don't remember the exact details, but if I remember correctly there are 2
ways:
1.
let the child attach the clip at the root, copy its bitmap data and use that
to create a clip in its own root, but this will result in static bitmaps
only

2.
-declare an empty clip with linkage id in the root and export it for runtime
sharing
-in the child import the clip from the parent for runtime sharing
It was one of those hacks, but it's been a long time, so I'm not sure I got
the steps all right, I might have those files somewhere.

Hope that helps!
Hans
On Tue, Sep 22, 2009 at 5:50 AM, Andrew Sinning and...@learningware.comwrote:

 How would one instantiate a symbol instance linked to the parent movie's
 library?

 E.g., there's an asset in top most movie's library called Asset.  The
 presentation engine is a separate swf that gets loaded into the top most
 movie.  From within this movie, using AS2, I need to create an instance of
 Asset.

 The child swf uses _lockRoot.

 Thanks!
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] instantiate symbol linked to parent movie's library

2009-09-22 Thread Andrew Sinning
Or, maybe I could call a function in the root that would instantiate the 
symbol, passing the target clip?


I'll post my resutls.


Hans Wichman wrote:

Hi,

I don't remember the exact details, but if I remember correctly there are 2
ways:
1.
let the child attach the clip at the root, copy its bitmap data and use that
to create a clip in its own root, but this will result in static bitmaps
only

2.
-declare an empty clip with linkage id in the root and export it for runtime
sharing
-in the child import the clip from the parent for runtime sharing
It was one of those hacks, but it's been a long time, so I'm not sure I got
the steps all right, I might have those files somewhere.

Hope that helps!
Hans
On Tue, Sep 22, 2009 at 5:50 AM, Andrew Sinning and...@learningware.comwrote:

  

How would one instantiate a symbol instance linked to the parent movie's
library?

E.g., there's an asset in top most movie's library called Asset.  The
presentation engine is a separate swf that gets loaded into the top most
movie.  From within this movie, using AS2, I need to create an instance of
Asset.

The child swf uses _lockRoot.

Thanks!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

  


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] instantiate symbol linked to parent movie's library

2009-09-22 Thread jonathan howe
Totally forget in AS2, but maybe research getDefinitionByName() - it can
retrieve a class based on a classname string -  and maybe there are some
comments about AS2 vs. AS3

-jonathan



On Tue, Sep 22, 2009 at 2:54 AM, Hans Wichman 
j.c.wich...@objectpainters.com wrote:

 Hi,

 I don't remember the exact details, but if I remember correctly there are 2
 ways:
 1.
 let the child attach the clip at the root, copy its bitmap data and use
 that
 to create a clip in its own root, but this will result in static bitmaps
 only

 2.
 -declare an empty clip with linkage id in the root and export it for
 runtime
 sharing
 -in the child import the clip from the parent for runtime sharing
 It was one of those hacks, but it's been a long time, so I'm not sure I got
 the steps all right, I might have those files somewhere.

 Hope that helps!
 Hans
 On Tue, Sep 22, 2009 at 5:50 AM, Andrew Sinning and...@learningware.com
 wrote:

  How would one instantiate a symbol instance linked to the parent movie's
  library?
 
  E.g., there's an asset in top most movie's library called Asset.  The
  presentation engine is a separate swf that gets loaded into the top most
  movie.  From within this movie, using AS2, I need to create an instance
 of
  Asset.
 
  The child swf uses _lockRoot.
 
  Thanks!
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
-jonathan howe
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] instantiate symbol linked to parent movie's library

2009-09-22 Thread Hans Wichman
Hi,

calling a function in the root that would instantiate the symbol is not
going to work, neither is using reflection to get classes by name. The issue
you are dealing with is that by default flash will only let you attach
clips to a clip from the library from whence it came.
I'll try to whip up a sample up of the runtime share hack.

greetz
JC

On Tue, Sep 22, 2009 at 2:08 PM, jonathan howe jonathangh...@gmail.comwrote:

 Totally forget in AS2, but maybe research getDefinitionByName() - it can
 retrieve a class based on a classname string -  and maybe there are some
 comments about AS2 vs. AS3

 -jonathan



 On Tue, Sep 22, 2009 at 2:54 AM, Hans Wichman 
 j.c.wich...@objectpainters.com wrote:

  Hi,
 
  I don't remember the exact details, but if I remember correctly there are
 2
  ways:
  1.
  let the child attach the clip at the root, copy its bitmap data and use
  that
  to create a clip in its own root, but this will result in static bitmaps
  only
 
  2.
  -declare an empty clip with linkage id in the root and export it for
  runtime
  sharing
  -in the child import the clip from the parent for runtime sharing
  It was one of those hacks, but it's been a long time, so I'm not sure I
 got
  the steps all right, I might have those files somewhere.
 
  Hope that helps!
  Hans
  On Tue, Sep 22, 2009 at 5:50 AM, Andrew Sinning and...@learningware.com
  wrote:
 
   How would one instantiate a symbol instance linked to the parent
 movie's
   library?
  
   E.g., there's an asset in top most movie's library called Asset.  The
   presentation engine is a separate swf that gets loaded into the top
 most
   movie.  From within this movie, using AS2, I need to create an instance
  of
   Asset.
  
   The child swf uses _lockRoot.
  
   Thanks!
   ___
   Flashcoders mailing list
   Flashcoders@chattyfig.figleaf.com
   http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 



 --
 -jonathan howe
  ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] instantiate symbol linked to parent movie's library

2009-09-22 Thread Hans Wichman
Hi Andrew,

i've put a sample together at:
http://www.objectpainters.com/downloads/runtimesharinghack.zip

user/pass is blog/blog

There are 2 demos, the first of how you probably do it at the moment, you
load a sub into main and try to attach a clip from main to sub. The sample
shows that doesnt work by default.

The second sample added a couple of things:
-main exports a hack_clip at main.swf for runtime sharing.
-sub imports a hack_clip from main.swf for runtime sharing AND puts it on
the stage.

If you run the 2nd example you see there is no problem attaching a clip from
main to sub, even though the attached clip had nothing to do with runtime
sharing, only the hack_clip did.

In practice you need to account for a couple things:
- runtime library sharing is not without it's own problems, but since you
can be sure main.swf is already in the cache by the time sub.swf requires
it, you're on the safe side
- i've never ever used this hack in a real project, so there is some risk
involved in using it (but ain't it spiffy ;)).

regards,
JC




On Tue, Sep 22, 2009 at 7:43 PM, Hans Wichman 
j.c.wich...@objectpainters.com wrote:

 Hi,

 calling a function in the root that would instantiate the symbol is not
 going to work, neither is using reflection to get classes by name. The issue
 you are dealing with is that by default flash will only let you attach
 clips to a clip from the library from whence it came.
 I'll try to whip up a sample up of the runtime share hack.

 greetz
 JC

   On Tue, Sep 22, 2009 at 2:08 PM, jonathan howe 
 jonathangh...@gmail.comwrote:

 Totally forget in AS2, but maybe research getDefinitionByName() - it can
 retrieve a class based on a classname string -  and maybe there are some
 comments about AS2 vs. AS3

 -jonathan



 On Tue, Sep 22, 2009 at 2:54 AM, Hans Wichman 
 j.c.wich...@objectpainters.com wrote:

  Hi,
 
  I don't remember the exact details, but if I remember correctly there
 are 2
  ways:
  1.
  let the child attach the clip at the root, copy its bitmap data and use
  that
  to create a clip in its own root, but this will result in static bitmaps
  only
 
  2.
  -declare an empty clip with linkage id in the root and export it for
  runtime
  sharing
  -in the child import the clip from the parent for runtime sharing
  It was one of those hacks, but it's been a long time, so I'm not sure I
 got
  the steps all right, I might have those files somewhere.
 
  Hope that helps!
  Hans
  On Tue, Sep 22, 2009 at 5:50 AM, Andrew Sinning 
 and...@learningware.com
  wrote:
 
   How would one instantiate a symbol instance linked to the parent
 movie's
   library?
  
   E.g., there's an asset in top most movie's library called Asset.
  The
   presentation engine is a separate swf that gets loaded into the top
 most
   movie.  From within this movie, using AS2, I need to create an
 instance
  of
   Asset.
  
   The child swf uses _lockRoot.
  
   Thanks!
   ___
   Flashcoders mailing list
   Flashcoders@chattyfig.figleaf.com
   http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 



 --
 -jonathan howe
  ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] instantiate symbol linked to parent movie's library

2009-09-22 Thread Andrew Sinning
Thanks Hans.  Yes, I tried this myself this morning.  I'm working in 
AS2.  I'm pretty much ruling this out.  I think it will be more trouble 
than it's worth.


A little background will clarify why:

Our goal was to allow an instructor to create content and then export 
that content in a single swf file.  We'd use swfmill + mtasc to create 
the swf from within our content-creator application.  They'd then be 
able to upload that swf to any LMS.  The presentation engine and the 
other secure operations would reside in a static swf that would reside 
in on our server.


Just a pipe dream.  I'm ready to move on to more viable solutions.


Hans Wichman wrote:

Hi,

calling a function in the root that would instantiate the symbol is not
going to work, neither is using reflection to get classes by name. The issue
you are dealing with is that by default flash will only let you attach
clips to a clip from the library from whence it came.
I'll try to whip up a sample up of the runtime share hack.

greetz
JC

On Tue, Sep 22, 2009 at 2:08 PM, jonathan howe jonathangh...@gmail.comwrote:

  

Totally forget in AS2, but maybe research getDefinitionByName() - it can
retrieve a class based on a classname string -  and maybe there are some
comments about AS2 vs. AS3

-jonathan



On Tue, Sep 22, 2009 at 2:54 AM, Hans Wichman 
j.c.wich...@objectpainters.com wrote:



Hi,

I don't remember the exact details, but if I remember correctly there are
  

2


ways:
1.
let the child attach the clip at the root, copy its bitmap data and use
that
to create a clip in its own root, but this will result in static bitmaps
only

2.
-declare an empty clip with linkage id in the root and export it for
runtime
sharing
-in the child import the clip from the parent for runtime sharing
It was one of those hacks, but it's been a long time, so I'm not sure I
  

got


the steps all right, I might have those files somewhere.

Hope that helps!
Hans
On Tue, Sep 22, 2009 at 5:50 AM, Andrew Sinning and...@learningware.com
  

wrote:

How would one instantiate a symbol instance linked to the parent


movie's


library?

E.g., there's an asset in top most movie's library called Asset.  The
presentation engine is a separate swf that gets loaded into the top


most


movie.  From within this movie, using AS2, I need to create an instance


of
  

Asset.

The child swf uses _lockRoot.

Thanks!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

  


--
-jonathan howe
 ___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

  


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] instantiate symbol linked to parent movie's library

2009-09-22 Thread Andrew Sinning
That's super cool.  So the sub only has to have a _single_ library item 
from the shared library in order to have access to the whole library.  
That's not very intuitive, but I'm really glad it works!




Hans Wichman wrote:

Hi Andrew,

i've put a sample together at:
http://www.objectpainters.com/downloads/runtimesharinghack.zip

user/pass is blog/blog

There are 2 demos, the first of how you probably do it at the moment, you
load a sub into main and try to attach a clip from main to sub. The sample
shows that doesnt work by default.

The second sample added a couple of things:
-main exports a hack_clip at main.swf for runtime sharing.
-sub imports a hack_clip from main.swf for runtime sharing AND puts it on
the stage.

If you run the 2nd example you see there is no problem attaching a clip from
main to sub, even though the attached clip had nothing to do with runtime
sharing, only the hack_clip did.

In practice you need to account for a couple things:
- runtime library sharing is not without it's own problems, but since you
can be sure main.swf is already in the cache by the time sub.swf requires
it, you're on the safe side
- i've never ever used this hack in a real project, so there is some risk
involved in using it (but ain't it spiffy ;)).

regards,
JC




On Tue, Sep 22, 2009 at 7:43 PM, Hans Wichman 
j.c.wich...@objectpainters.com wrote:

  

Hi,

calling a function in the root that would instantiate the symbol is not
going to work, neither is using reflection to get classes by name. The issue
you are dealing with is that by default flash will only let you attach
clips to a clip from the library from whence it came.
I'll try to whip up a sample up of the runtime share hack.

greetz
JC

  On Tue, Sep 22, 2009 at 2:08 PM, jonathan howe jonathangh...@gmail.comwrote:



Totally forget in AS2, but maybe research getDefinitionByName() - it can
retrieve a class based on a classname string -  and maybe there are some
comments about AS2 vs. AS3

-jonathan



On Tue, Sep 22, 2009 at 2:54 AM, Hans Wichman 
j.c.wich...@objectpainters.com wrote:

  

Hi,

I don't remember the exact details, but if I remember correctly there


are 2
  

ways:
1.
let the child attach the clip at the root, copy its bitmap data and use
that
to create a clip in its own root, but this will result in static bitmaps
only

2.
-declare an empty clip with linkage id in the root and export it for
runtime
sharing
-in the child import the clip from the parent for runtime sharing
It was one of those hacks, but it's been a long time, so I'm not sure I


got
  

the steps all right, I might have those files somewhere.

Hope that helps!
Hans
On Tue, Sep 22, 2009 at 5:50 AM, Andrew Sinning 


and...@learningware.com
  

wrote:
  
How would one instantiate a symbol instance linked to the parent
  

movie's
  

library?

E.g., there's an asset in top most movie's library called Asset.
  

 The
  

presentation engine is a separate swf that gets loaded into the top
  

most
  

movie.  From within this movie, using AS2, I need to create an
  

instance
  

of


Asset.

The child swf uses _lockRoot.

Thanks!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

  

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




--
-jonathan howe
 ___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

  


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

  


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] instantiate symbol linked to parent movie's library

2009-09-22 Thread Hans Wichman
Hi Andrew,

yes only a single library item. Still before basing a large scale email
application on something like this would not make me sleep well at night,
unless there wasn't another way. Seeing the large numbers of elearning apps
already written in flash, there probably is another way;).
From what you describe, maybe you could use:
- a template that's loaded by the main engine which loads xml and does
things based on that (instead of generating it statically to an swf using
swfmill, you'd have different templates).
- non library based assets, completely drawn in actionscript, that way
recompiling them into the main after changing, would change them for all the
subs even if they were compiled with another version of the actionscript
asset another time
- use the bitmap based approach earlier
- an asset swf that gets loaded by each sub swf only once and is used as a
container to attach the assets from it's own library to as well

One thing I would do is check whether this still works like this in as3 for
example.

On the other hand if it works it works and if you're under a lot of time
pressure this might just be what you need ;)

take care
Hans

On Tue, Sep 22, 2009 at 8:47 PM, Andrew Sinning and...@learningware.comwrote:

 That's super cool.  So the sub only has to have a _single_ library item
 from the shared library in order to have access to the whole library.
  That's not very intuitive, but I'm really glad it works!




 Hans Wichman wrote:

 Hi Andrew,

 i've put a sample together at:
 http://www.objectpainters.com/downloads/runtimesharinghack.zip

 user/pass is blog/blog

 There are 2 demos, the first of how you probably do it at the moment, you
 load a sub into main and try to attach a clip from main to sub. The sample
 shows that doesnt work by default.

 The second sample added a couple of things:
 -main exports a hack_clip at main.swf for runtime sharing.
 -sub imports a hack_clip from main.swf for runtime sharing AND puts it on
 the stage.

 If you run the 2nd example you see there is no problem attaching a clip
 from
 main to sub, even though the attached clip had nothing to do with runtime
 sharing, only the hack_clip did.

 In practice you need to account for a couple things:
 - runtime library sharing is not without it's own problems, but since you
 can be sure main.swf is already in the cache by the time sub.swf requires
 it, you're on the safe side
 - i've never ever used this hack in a real project, so there is some risk
 involved in using it (but ain't it spiffy ;)).

 regards,
 JC




 On Tue, Sep 22, 2009 at 7:43 PM, Hans Wichman 
 j.c.wich...@objectpainters.com wrote:



 Hi,

 calling a function in the root that would instantiate the symbol is not
 going to work, neither is using reflection to get classes by name. The
 issue
 you are dealing with is that by default flash will only let you attach
 clips to a clip from the library from whence it came.
 I'll try to whip up a sample up of the runtime share hack.

 greetz
 JC

  On Tue, Sep 22, 2009 at 2:08 PM, jonathan howe jonathangh...@gmail.com
 wrote:



 Totally forget in AS2, but maybe research getDefinitionByName() - it can
 retrieve a class based on a classname string -  and maybe there are some
 comments about AS2 vs. AS3

 -jonathan



 On Tue, Sep 22, 2009 at 2:54 AM, Hans Wichman 
 j.c.wich...@objectpainters.com wrote:



 Hi,

 I don't remember the exact details, but if I remember correctly there


 are 2


 ways:
 1.
 let the child attach the clip at the root, copy its bitmap data and use
 that
 to create a clip in its own root, but this will result in static
 bitmaps
 only

 2.
 -declare an empty clip with linkage id in the root and export it for
 runtime
 sharing
 -in the child import the clip from the parent for runtime sharing
 It was one of those hacks, but it's been a long time, so I'm not sure I


 got


 the steps all right, I might have those files somewhere.

 Hope that helps!
 Hans
 On Tue, Sep 22, 2009 at 5:50 AM, Andrew Sinning 


 and...@learningware.com


 wrote:
  How would one instantiate a symbol instance linked to the
 parent


 movie's


 library?

 E.g., there's an asset in top most movie's library called Asset.


  The


 presentation engine is a separate swf that gets loaded into the top


 most


 movie.  From within this movie, using AS2, I need to create an


 instance


 of


 Asset.

 The child swf uses _lockRoot.

 Thanks!
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




 --
 -jonathan howe
  ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders