Re: Inserting action script variables to a frame
"Niek Schroten" <[email protected]> Fri, 10 Jan 2003 14:38:06 +0100
| Newsgroups | gmane.comp.java.jgenerator.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Andrew,
I managed to do it, that is, I'm able to use variables in the actions script
in this way:
StandardContext aStandardContext = new StandardContext();
aStandardContext.setValue("variable name", "somevalue");
aFlashFile.processFile(aStandardContext);
In this way it is not really set I think in the action script, but since
they are apperently global variables they can be used.
Thanks for your offer to look at thet swf!
Regards,
Niek
----- Original Message -----
From: "Andrew Watson" <[email protected]>
To: <[email protected]>
Sent: Wednesday, January 08, 2003 11:59 PM
Subject: RE: [Jgen-devel] Inserting action script variables to a frame
> I haven't looked into how the ASAssembler code works too much, but as I
see it there are two possible issues.
>
> 1 - You are trying to set a variable that is not defined. I'm pretty
sure, that even though Flash lets you use a variable without defining it,
when it comes to action script it is always defined somehow... either with a
DefineLocal, DefineLocal2 or ActionConstantPool, so in effect you are trying
to set the value of a variable that doesn't exist, which the flash
interpreter just seems to ignore. To remove this error, you could use
aASAssembler.localVar("extension", ".COM") instead of the setVar call.
>
> 2 - Even once this is added to the action script, I'm a bit hazy on
whether it actually gets added to the movie or not.. if you try the above
and it doesn't fix the error, send me an example swf (before and after) and
I will look into it further.
>
> Andrew Watson.
>
> -----Original Message-----
> From: Niek Schroten [SMTP:[email protected]]
> Sent: Wednesday, January 08, 2003 11:09 PM
> To: [email protected]
> Subject: [Jgen-devel] Inserting action script variables to a frame
>
> Hi,
>
> 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 buttonx = 265;
> var buttony = 12;
> var buttonwidth = 145;
>
> var movingout = 0;
> var movingin = 0;
> var currentout = 0;
> var takesteps = 8;
> var currentstep = 0;
>
> 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):
> FlashBuffer aFlashBuffer = new FlashBuffer(_aShockWaveTemplateByteArray);
> try{
> aFlashFile = FlashFile.parse("temp.swt",aFlashBuffer);
> ASAssembler aASAssembler = new ASAssembler(aFlashFile);
> aASAssembler.setVar("extension",".COM");
> ..... etc.
> All the objects are in the outputfile, but the variable extension is not
in
> the script.
>
> Any suggestions?
> Thanks in advance,
>
> Niek
>
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> Jgen-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jgen-devel
>
> __________ Information from NOD32 1.342 (20030107) __________
>
> This message was checked by NOD32 for Exchange e-mail monitor.
> http://www.nod32.com
>
>
>
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld
http://www.vasoftware.com
> _______________________________________________
> Jgen-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jgen-devel
>
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com