I was just doing something similar, using just PHP and jQuery.

I scan a folder with swf's, print an array in JavaScript, from
JavaScript I iterate through the array calling a function inside
validator.swf, which loads an swf it receives as a parameter.
Then validator.swf checks the instance names of objects in its
stage, looks for classes with that name, and sends the result
back to JavaScript, inserting the result into the HTML
using jQuery... oops I didn't think it was twisted when I did it =)

It could be extended to test if the exported classes implement
some methods, or something in that direction.

I mention this because with both Air and PHP you have methods
to scan folders in the disk, get file sizes, timestamps, etc.

Abe

Ian Thomas wrote:
I was wondering about some sort of bridge - how about a 'loader' swf
which you load from outside the AIR security sandbox. Talk to it via
LocalConnections - get it to load in swfs for test and report back via
LocalConnection.

That'd work, but is an ugly hack.

However - as far as I can see, you aren't actually writing to disk,
are you? So why do you need AIR? Wouldn't an ordinary Flash projector
do the job without any of these issues?

HTH,
  Ian

On Thu, Apr 24, 2008 at 9:20 AM, John Eriksson <[EMAIL PROTECTED]> wrote:
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

Reply via email to