Yes. I have understood this when doing some research on the subject. My
problem though is that I don't want theswfs to be installed together with
the app (a few thousand swfs altogether). I want my AIR App to load a dir
full of them
and walk through them all and check if they implement a certain interface.
I've done all these things, my only problem now
is that I cannot cast them in AIR at all which makes the whole thing
pointless.

You see my problem here right? I need it to load arbitrary swfs from a
harddrive or network share (i.e locally through the filesystem)
and try to cast them to an interface - throw up a warning or generate a list
of swfs that do not conform to the interface and need to
be fixed.

I guess this cannot be easily done, or perhaps not at all... Could it be
possible through a sandbox bridge or something like that?

/John

2008/4/24 Ian Thomas <[EMAIL PROTECTED]>:

> Hi John,
>   Where are you loading the SWF from?
>
>   I think I had this problem early on with AIR, and it turned out I
> was loading from the wrong place. If you load the .swf files from
> within the AIR app's installed folder, then they are given full rights
> and you will be able to cast them etc. If you load them from anywhere
> else, they are placed into a different security sandbox and you won't
> be able to cast them.
>
>  This page should help:
> http://livedocs.adobe.com/flex/3/html/security_6.html
> (see under URL schemes)
>
> Hope that's helpful,
>   Ian
>
> On Wed, Apr 23, 2008 at 6:50 PM, John Axel Eriksson <[EMAIL PROTECTED]>
> wrote:
> > I'm trying to develop an application using AIR for internal use at our
> > company.
> >
> >  Our company uses very advanced actionscript (3.0) on the web, we load
> for
> > instance
> >  several hundred or maybe more swfs sometimes into a parent swf, some
> that
> > are animated.
> >
> >  Recently we decided that we need control over these loaded animated
> swfs -
> > they need
> >  to adhere to an interface so we can stop the animations from the
> loading
> > application when needed.
> >  The animations can be both timeline based and script based. As long as
> they
> > adhere to the interface
> >  (basically play() stop() reset() and the "running" getter should return
> > true if playing or false if stopped) we should be just fine.
> >
> >  The problem is that we need people who don't really know any scripting
> > (designers) to be able to publish these
> >  files properly. And I guess a template goes a long way but still...
> >
> >  So I thought: Hey there's AIR which have local filesystem access among
> > other things. I could build an AIR App which
> >  loads a swf or even a whole dir of swfs and then casts the loaded swfs
> to
> > IAnimatedItem and throws an error if it cant.
> >  It could also include play stop reset buttons to test every loaded swf
> > manually to be sure it works. Nice indeed and simple
> >  enough for most people to use...
> >
> >  The problem is though that I can't cast loaded swfs in AIR it seems,
> though
> > I can from a simple swf loading one of these items
> >  (but then I lose filesystem dialogs etc which is why I thought of AIR
> in
> > the first place).
> >
> >  In AIR
> >  var aim:IAnimatedItem = loader.content as IAnimatedItem; (or
> > loader.contentLoaderInfo.content as IAnimatedItem doesn't matter).
> >
> >  aim becomes null.
> >
> >  In simple Flash swf:
> >
> >  aim becomes IAnimatedItem.
> >
> >
> >  if I do this in AIR:
> >
> >  var aim:IAnimatedItem = loader.content as IAnimatedItem;
> >
> >  if(aim is IAnimatedItem){
> >         trace('is IAnimatedItem');
> >  } else {
> >         trace('is NOT IAnimatedItem');
> >  }
> >
> >  this traces 'is NOT IAnimatedItem';
> >
> >  **
> >
> >  in simple Flash swf the same traces:
> >
> >  'is IAnimatedItem';
> >
> >  **
> >
> >  Also, doing a describeType in AIR OR Flash swf actually says it DOES
> > implement IAnimatedItem. But, as I said, only in normal
> >  flash swfs is it castable to an IAnimatedItem. Why? Does this have
> > something to do with the AIR security model and does anyone
> >  know how I can achieve what I want in AIR?
> >
> >
> >  /John
> >  _______________________________________________
> >  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