"I'll do a test to see what the difference in speed is with AS2's
SetVariable."

There's a huge difference. SetVariable is near instant where EI has to
encode/decode the value you are passing into/from XML.

>From a browser you don't see the XML, but that's what's going on. The
container is responsible for handling the conversion.

What would have been great is to have a way to bypass the XML encode/decode
if you know you just want to pass a string. I understand the beauty of being
able to pass simple datatypes, but really, SetVariable hasn't been replaced.

I'm guessing it was assumed that most people wouldn't be transferring a lot
of data at once.

Some people have created a hack of chopping up the data and sending it in an
interval.

You can still use fscommand to send data out without any encoding going on.
The bottle-neck, then, is getting data into Flash.

If you do use fscommand you might want to check this out:
FSCommand and getURL Bug in Flash Player 9
http://www.northcode.com/blog.php/2007/09/11/FSCommand-and-getURL-Bug-in-Flash-Player-9

On a sidenote: SetVariable does work but it only sends to AVM1. So if you
have an AS3 project and load an AS1/AS2 SWF, AVM1 is used for that SWF and
you can get data into that SWF using SetVariable. The problem, of course, is
that there's only one way to get data from AVM1 to AVM2 (without using EI
again) and that's LocalConnection <shudder />, which is slower than EI.


On 9/24/07, Bart Wttewaall <[EMAIL PROTECTED]> wrote:
>
>   Thanks for answering Alex.
>
> At least External Interface works, so I'll just build on that. I'll do a
> test to see what the difference in speed is with AS2's SetVariable. Not that
> it matters since we don't have any options, but hey, curiosity ain't a sin,
> right? I'll post my findings later this week.
>
> Bart
>
> 2007/9/24, Alex Harui <[EMAIL PROTECTED]>:
> >
> >    setVariable is not supported in AS3.  It is reflected back to the JS
> > layer, so getVariable works, but you can't get to it from AS3.  I don't know
> > if EI is still that much slower, so give it a try. The last person who ran
> > into this just make a JS wrapper from setVariable to EI.
> >
> >
> >  ------------------------------
> >
> > *From:* [EMAIL PROTECTED] ups.com [mailto:[EMAIL PROTECTED] ups.com]
> > *On Behalf Of *Bart Wttewaall
> > *Sent:* Monday, September 24, 2007 2:58 AM
> > *To:* flexcoders@yahoogroups.com
> > *Subject:* [flexcoders] SetVariable vs External Interface & AS3's root
> >
> >
> >
> > Hi List,
> >
> > I made an application in AS2 a while ago that got fed values externally
> > by LUA code. There were 2 ways of doing this: by making use of External
> > Interface, or by using flashobject.SetVariable (prop, value).
> >
> > After some tests it became clear that the use of External Interface was
> > as much as 15x slower than setting a property on the _root with SetVariable,
> > so I implemented a method of registering those _root properties and watched
> > them with Object.watch(), dispatching an event whenever the value
> > changed.
> >
> > Now we're ready to port the application to AS3 (Flex 2), but since there
> > is no more _root I'm at a loss of where the properties are set in the
> > application. I haven't found them in Application.application.root. They
> > ARE being set, since after setting a property's value, I can access it using
> > GetVariable. So where can I access it from within my application? I'd like
> > to listen to incomming data in this way. If possible I woulnd't want to use
> > the External Interface, unless you tell me the '15x slower issue' has been
> > resolved.
> >
> > I thought that the LoaderInfo class had something to do with it, but it
> > seems to only return parameters that are set with the flashobject at
> > initialization...
> >
> > Thanks in advance,
> >
> > Bart Wttewaall
> >
> >
>  
>



-- 

Derek Vadneau

Reply via email to