Hi Paul,

What we do is have a swf that has a library of animations or images, all 
contained in movie clips. These movie clips are then dropped onto the stage and 
each instance given a name.

Once the swf is loaded you can then reference the instance by using 
getChildByName("instanceName"). Once you have reference to that animation you 
can throw it into any display object and it will show up in your app.

To get around with the stop limitation you can use some code to dynamically add 
code to the animations after you have gotten access to them. We do something 
like this to dynamically add stop code just before each frame label of a movie 
clip. Then you 

for each (var fLabel:FrameLabel in _skin.currentLabels)
                        {
                                _frameLabels.push(fLabel.name);
                                var labelFrame:int = fLabel.frame
                                if (labelFrame > 1)
                                {
                                        //for addFrameScript the frame numbers 
are 0 based
                                        //to add a stop frame on the one 
previous to the current frame label: -2
                                        _skin.addFrameScript(labelFrame - 2, 
function ():void{_skin.stop()});
                                }
                        }
                        //add a stop on the last frame of the skin
                        _skin.addFrameScript(_skin.totalFrames - 2, function 
():void{_skin.stop()});

hth,

Rob



On 2012-06-14, at 9:06 AM, Paul Steven wrote:

> Rob
> 
> Can you elaborate on this further please?
> 
> I am working on an iPad only app using Flash CS5.5 and the client has asked
> if the app could load in animated graphs. I initially thought this would be
> easy loading in a swf but then discovered that not even a stop action was
> possible.
> 
> It sounds like you may have an alternative solution so would be interested
> to know more.
> 
> Thanks
> 
> Paul
> 
> -----Original Message-----
> From: flashcoders-boun...@chattyfig.figleaf.com
> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Rob Romanek
> Sent: 14 June 2012 13:58
> To: Flash Coders List
> Subject: Re: [Flashcoders] elearing content using adobe air for ipad
> 
> Hi,
> 
> You can load swfs into the app BUT the swfs can not contain any action
> script in them. This includes giving class names to items in your library or
> even simple "stop()" commands.
> 
> We use swfs as external libraries in our as3 built apps but our approach has
> been to put items on the stage and name those instances (which you can do
> with imported swfs). Then use getChildByName to extract the instances we
> need.
> 
> You definitely need to use Apple's philosophy and "Think Different" but it
> does work.
> 
> cheers,
> 
> Rob
> 
> 
> On 2012-06-13, at 10:04 AM, Hans Wichman wrote:
> 
>> . *However* as far as I know you cannot load an swf with it. This might
> require a different architectural setup than you had in mind.
>> 
>> 
>> 
>> On 13-6-2012 15:35, Sumeet Kumar wrote:
>>> Thanks a lot for such a quick reply.
>>> 
>>> I haven't googled  it much but you guessed it right,  I am bit 
>>> worried about some features like
>>> 
>>> 1.   Will urlloader/loader(inbuilt as3 class) classes work fine. I wish
>>> to load swf built in as3 in my main file.
> 
> 
> _______________________________________________
> 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

Reply via email to