RE: Inserting action script variables to a frame

Andrew Watson <[email protected]> Thu, 9 Jan 2003 09:59:29 +1100
Newsgroups gmane.comp.java.jgenerator.devel
Message-ID <[email protected]>
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 =3D 265;
var buttony =3D 12;
var buttonwidth =3D 145;

var movingout =3D 0;
var movingin =3D 0;
var currentout =3D 0;
var takesteps =3D 8;
var currentstep =3D 0;

var prevy=3D0;
var prevx=3D0;
var holdcount=3D0;


I's like to add some variables to this list (like var name=3D"value";).
Is this possible? If so, how can this be done?
I tried the following in my code (did not work):
FlashBuffer aFlashBuffer =3D new =
FlashBuffer(_aShockWaveTemplateByteArray);
 try{
     aFlashFile =3D FlashFile.parse("temp.swt",aFlashBuffer);
     ASAssembler aASAssembler  =3D 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 =3D 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 = Something 2 See!
http://www.vasoftware.com