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 <[email protected]>wrote:

> 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 <
>> [email protected]> 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 <[email protected]
>>> >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 <
>>>> [email protected]> 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 <
>>>>>
>>>>>
>>>> [email protected]
>>>>
>>>>
>>>>> 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
>>>>>> [email protected]
>>>>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>>>>>
>>>>>>
>>>>>>
>>>>> _______________________________________________
>>>>> Flashcoders mailing list
>>>>> [email protected]
>>>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> -jonathan howe
>>>>  _______________________________________________
>>>> 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