Re: [Flashcoders] Question about the AIR security model...

2008-04-25 Thread EECOLOR
Describe type is quite a heavy operation. I am not sure if it would affect
this application though. It indeed is an easy solution :) Another solution
would be to call the
loader.contentLoaderInfo.applicationDomain.hasDefinition(name:String):Boolean
method.

As far as the original problem is concerned, my thoughts about it:

When you load content from another domain (which is the case when loading
swf's in AIR from another location) they will automatically be loaded into a
child application domain. This means that both parent (the domain of the AIR
application) and child domain (the domain of the
swf) contain an definition of IAnimatedItem.

If you then check if the swf implements the parent definition it will return
false. The parent definition is not the same as the child definition.


Greetz Erik

On 4/25/08, Ian Thomas <[EMAIL PROTECTED]> wrote:
>
> Oh, of course - describeType. Good solution. :-)
>
>
> Ian
>
>
> On Fri, Apr 25, 2008 at 9:14 AM, John Eriksson <[EMAIL PROTECTED]> wrote:
>
> >  I've actually solved my problem in an unorthodox way currently. I've
> written
> >  a check method
> >  that does a describeType on the content of the Loader and if it sees
> that it
> >  implements the proper interface
> >  and also has all the proper methods it oks the swf.
>
> ___
> 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] Question about the AIR security model...

2008-04-25 Thread Ian Thomas
Oh, of course - describeType. Good solution. :-)

Ian

On Fri, Apr 25, 2008 at 9:14 AM, John Eriksson <[EMAIL PROTECTED]> wrote:

>  I've actually solved my problem in an unorthodox way currently. I've written
>  a check method
>  that does a describeType on the content of the Loader and if it sees that it
>  implements the proper interface
>  and also has all the proper methods it oks the swf.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Question about the AIR security model...

2008-04-25 Thread John Eriksson
Yeah it is backwards for me. I would have to change every swf loaded for
this to work.
The byteArray suggestion is the best suggestion so far, gotta try that out
:-)

I've actually solved my problem in an unorthodox way currently. I've written
a check method
that does a describeType on the content of the Loader and if it sees that it
implements the proper interface
and also has all the proper methods it oks the swf.

To actually call the methods of the loaded swf I had to use an untyped var -
then it doesn't complain. I
only do this after my check method has ok'd it.


Thanks,
John

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

> Hi Peter,
>
>   It's the first time I've come across sandbox bridging. It's a nifty idea.
>
> The Flash documentation for it is here:
>
> http://livedocs.adobe.com/flex/3/langref/flash/display/LoaderInfo.html#childSandboxBridge
>
> But... unfortunately I think it's backwards for John's problem. It
> allows a parent SWF to expose properties to a child SWF, rather than
> the other way around...
>
> Ian
>
> On Thu, Apr 24, 2008 at 9:58 AM, Peter B <[EMAIL PROTECTED]> wrote:
> > Could sandbox bridging help here?
> >
> >  http://www.adobe.com/devnet/air/ajax/quickstart/sandbox_bridge.html
> >
> >  This example descibes loading local HTML files, but the same rules
> apply...
> >
> >  Pete
> >
> >
> > ___
> >  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] Question about the AIR security model...

2008-04-24 Thread Abe Pazos

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');
 > >  } els

Re: [Flashcoders] Question about the AIR security model...

2008-04-24 Thread Ian Thomas
Hi Peter,

   It's the first time I've come across sandbox bridging. It's a nifty idea.

The Flash documentation for it is here:
http://livedocs.adobe.com/flex/3/langref/flash/display/LoaderInfo.html#childSandboxBridge

But... unfortunately I think it's backwards for John's problem. It
allows a parent SWF to expose properties to a child SWF, rather than
the other way around...

Ian

On Thu, Apr 24, 2008 at 9:58 AM, Peter B <[EMAIL PROTECTED]> wrote:
> Could sandbox bridging help here?
>
>  http://www.adobe.com/devnet/air/ajax/quickstart/sandbox_bridge.html
>
>  This example descibes loading local HTML files, but the same rules apply...
>
>  Pete
>
>
> ___
>  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] Question about the AIR security model...

2008-04-24 Thread Ian Thomas
Jim,
   That's a great suggestion. :-)

Ian

On Thu, Apr 24, 2008 at 11:18 AM, Jim Hayes <[EMAIL PROTECTED]> wrote:
> Apparently, if you load the .swf as a byteArray then you can then use a
>  loader to load that as a swf, in the context of your application.
>  Normally that would be considered a potentially bad thing, but in your
>  case it looks like it could be exactly what you want to do.
>
>  Hth.
>
>
>
>  -Original Message-
>  From: [EMAIL PROTECTED]
>  [mailto:[EMAIL PROTECTED] On Behalf Of John
>  Eriksson
>  Sent: 24 April 2008 09:21
>  To: Flash Coders List
>  Subject: Re: [Flashcoders] Question about the AIR security model...
>
>  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 d

RE: [Flashcoders] Question about the AIR security model...

2008-04-24 Thread Jim Hayes
Apparently, if you load the .swf as a byteArray then you can then use a
loader to load that as a swf, in the context of your application.
Normally that would be considered a potentially bad thing, but in your
case it looks like it could be exactly what you want to do.

Hth.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of John
Eriksson
Sent: 24 April 2008 09:21
To: Flash Coders List
Subject: Re: [Flashcoders] Question about the AIR security model...

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 IAn

Re: [Flashcoders] Question about the AIR security model...

2008-04-24 Thread Peter B
Could sandbox bridging help here?

http://www.adobe.com/devnet/air/ajax/quickstart/sandbox_bridge.html

This example descibes loading local HTML files, but the same rules apply...

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


Re: [Flashcoders] Question about the AIR security model...

2008-04-24 Thread Ian Thomas
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

Re: [Flashcoders] Question about the AIR security model...

2008-04-24 Thread John Eriksson
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


Re: [Flashcoders] Question about the AIR security model...

2008-04-24 Thread Ian Thomas
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] Question about the AIR security model...

2008-04-23 Thread John Axel Eriksson
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