  | | adding muliple lines of AS script using JSFL
(continued from arc | adding muliple lines of AS script using JSFL
(continued from arc 2004-05-25 - By John Grden
Back I saw the posts about using \n for a return, and I had originally tried this, but when ever I add it in, flash throws an error. If I remove the returns, no error. I also tried chr(13) and chr(10) and of course it failed.
Any clues as to what I'm missing?
Code (basically):
private function buildAS(AS:String):Void
{
//...
sAS += AS + "\n";
//...
}
public function writeAS():Void
{
var iLayer:Number MMExecute("fl.getDocumentDOM().getTimeline().addNewLayer(\ "audioCode\", \"normal\", true);");
sAS = "";
buildAS("function runMe()");
buildAS("{");
buildAS(" for(var x:Number=0;x<array.length;x++)");
buildAS(" {");
buildAS(" trace(x);");
buildAS(" }");
buildAS("}");
_global.view("sAS", sAS);
MMExecute("fl.getDocumentDOM().getTimeline().layers[" + iLayer + "].frames[0].actionScript = \"" + sAS + "\";");
}
Tells me "a javascript error occurred"
John Grden
Senior Flash Developer
Blitz Digital Studios
[e] John@(protected)
[c] 714.326.7211
[b] 818.762.6888 x207
[w] www.BlitzDS.com
[a] Blitz DS
11336 Camarillo Street
Suite 200
North Hollywood, CA 91602
> -- --Original Message-- --
> From: Extendflash-bounces@(protected) [mailto:Extendflash-
> bounces@(protected)] On Behalf Of John Grden
> Sent: Monday, May 24, 2004 10:27 AM
> To: Extending Flash
> Subject: RE: [ExtendFlash] loading Custom SWF interface in Flash IDE
>
> Absolutely:
>
> When I load the interface, I iterate through the library looking for all
> sounds using itemType property of the item object. As I find a sound, I
> create another row in the grid, update a global object for sounds etc.
>
> Now, I noticed that when I trace out the length of the library, it's
> exponentially larger as I add more items to it. Is this correct?
>
> I'm assuming the slow down is directly related to the number of items in
> the library. But I'm concerned that the way I'm building my global object
> might be the problem as well. When a sound is found, I make 5 different
> MMExecute calls to grab variable information about the sound object. So,
> I'm wondering 3 things:
>
> 1. I haven't tried it, but should I just initialize my object with the
> item object? (IE: myGlobal_obj["sound_0"] = ...library.items[x] )
>
> 2. How much of a performance issue is it when using MMExecute?
>
> 3. Is there a performance advantage to utilizing a JSFL script over
> making MMExecute calls?
>
> Thanks for your help and time Sharon, I really appreciate it
>
> John Grden
> Senior Flash Developer
> Blitz Digital Studios
>
> [e] John@(protected)
> [c] 714.326.7211
> [b] 818.762.6888 x207
> [w] www.BlitzDS.com
>
> [a] Blitz DS
> 11336 Camarillo Street
> Suite 200
> North Hollywood, CA 91602
> > -- --Original Message-- --
> > From: Extendflash-bounces@(protected) [mailto:Extendflash-
> > bounces@(protected)] On Behalf Of Sharon Selden
> > Sent: Sunday, May 23, 2004 1:05 AM
> > To: 'Extending Flash'
> > Subject: RE: [ExtendFlash] loading Custom SWF interface in Flash IDE
> >
> > Can you be more specific about what you are trying to do? In general one
> > would have to iterate over all the items in the library. But depending
> on
> > what specifically you are trying to do there might be a more efficient
> way
> > to do it.
> > -
> > sharon
> >
> > > -- --Original Message-- --
> > > From: Extendflash-bounces@(protected)
> > > [mailto:Extendflash-bounces@(protected)]On Behalf Of John Grden
> > > Sent: Saturday, May 22, 2004 10:05 PM
> > > To: Extending Flash
> > > Subject: RE: [ExtendFlash] loading Custom SWF interface in Flash IDE
> > >
> > >
> > > Yes, that does help Sharon!
> > >
> > > I had looked at that example, but for some reason (maybe
> > > impatience), I couldn't find out where/how it was loaded from
> > > the commands menu. I located something in the archives for a
> > > batching process that was a perfect little example.
> > >
> > > One thing I could really use is a tutorial/info on itterating
> > > through the library efficiently. Right now, it seems to take
> > > a while with the initial load and I'm wondering if there are
> > > known better ways to go about it etc. Do you have anything
> > > out there that goes working with the library?
> > >
> > > Thanks for your help, much appreciated,
> > > John
> > >
> > > __ ____ ____ ____ ____ ____ ____
> > >
> > > From: Extendflash-bounces@(protected) on behalf of Sharon Selden
> > > Sent: Sat 5/22/2004 10:00 PM
> > > To: 'Extending Flash'
> > > Subject: RE: [ExtendFlash] loading Custom SWF interface in Flash IDE
> > >
> > >
> > >
> > > Don't know if this is what you're looking for but it may help:
> > > go to help >. samples > Building custom panels with the
> > > Extensibility API
> > >
> > > I would advise though that instead of placing your JS code in
> > > a big string
> > > and sending it through MMExecute, you put it in a separate
> > > jsfl and call it
> > > using MMExecute("fl.runscript(\"myScript.jsfl\")");
> > >
> > > that example was written before we had implemented the
> > > runScript command.
> > >
> > > Hope that helps,
> > > sharon
> > >
> > > > -- --Original Message-- --
> > > > From: Extendflash-bounces@(protected)
> > > > [mailto:Extendflash-bounces@(protected)]On Behalf Of John Grden
> > > > Sent: Saturday, May 22, 2004 9:20 PM
> > > > To: Extendflash@(protected)
> > > > Subject: [ExtendFlash] loading Custom SWF interface in Flash IDE
> > > >
> > > >
> > > > I've figured out how to load a custom interface via
> > > > "insert/timeline effects/..." but I know there HAS to be a
> > > > way to load one without having to select a movie clip on
> > > > stage and so forth.
> > > >
> > > > Has anyone any info on this? Tutorials? Sites that go over
> > > > the specifics of designing a custom interface?
> > > >
> > > > Thanks for your help,
> > > >
> > > > John Grden
> > > > Senior Flash Developer
> > > > BlitzDS.com
> > > > __ ____ ____ ____ ____ ____ ____ ____ ____ ____
> > > > Extendflash mailing list
> > > > Extendflash@(protected)
> > > > http://flashguru.co.uk/mailman/listinfo/extendflash_flashguru.co.uk
> > > >
> > >
> > > __ ____ ____ ____ ____ ____ ____ ____ ____ ____
> > > Extendflash mailing list
> > > Extendflash@(protected)
> > > http://flashguru.co.uk/mailman/listinfo/extendflash_flashguru.co.uk
> > >
> > >
> > >
> >
> > __ ____ ____ ____ ____ ____ ____ ____ ____ ____
> > Extendflash mailing list
> > Extendflash@(protected)
> > http://flashguru.co.uk/mailman/listinfo/extendflash_flashguru.co.uk
>
>
>
> __ ____ ____ ____ ____ ____ ____ ____ ____ ____
> Extendflash mailing list
> Extendflash@(protected)
> http://flashguru.co.uk/mailman/listinfo/extendflash_flashguru.co.uk
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ Extendflash mailing list Extendflash@(protected) http://flashguru.co.uk/mailman/listinfo/extendflash_flashguru.co.uk
|
|
 |