Re: Inserting action script variables to a frame
"Niek Schroten" <[email protected]> Mon, 13 Jan 2003 11:11:56 +0100
| Newsgroups | gmane.comp.java.jgenerator.devel |
|---|---|
| Message-ID | <[email protected]> |
Thanks! That was exactly what I was looking for! Niek ----- Original Message ----- From: "Dmitry Skavish" <[email protected]> To: "Niek Schroten" <[email protected]> Cc: <[email protected]> Sent: Friday, January 10, 2003 7:07 PM Subject: Re: [Jgen-devel] Inserting action script variables to a frame > Niek, > > > I'm new to this list, but I have a question. > > I'm trying to put some varibales in action script in a swt that alllready > > contains action script code. > > The code looks like this (actions for frame 2): > > var prevy=0; > > var prevx=0; > > var holdcount=0; > > > > I's like to add some variables to this list (like var name="value";). > > Is this possible? If so, how can this be done? > > I tried the following in my code (did not work): > > right way to do it: > > FlashFile file ....; > > 1. obtain the frame you want to put your actionscript to. in your case (frame 2) it will be: > > Frame frame = file.getMainScript().getFrameAt(1); // frames are counted from zero > > 2. create actionscript block (var myvar=10): > > ASAssembler as = new ASAssembler(file); > as.localVar("myvar", new Integer(10)); > > 3. create DoAction object: > > DoAction actions = new DoAction(as.toProgram()); > > 4. add the actions to the frame: > > frame.addFlashObject(actions); > > then you just need to generate the file and save it > > -- > Dmitry Skavish > ----------------------- > Boston, MA, USA > tel. +1 781 910-3810 > http://www.jzox.com > http://www.flashgap.com > > ------------------------------------------------------- This SF.NET email is sponsored by: FREE SSL Guide from Thawte are you planning your Web Server Security? Click here to get a FREE Thawte SSL guide and find the answers to all your SSL security issues. http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en