Re: set properties (scale swf) problem

Dmitry Skavish <[email protected]> Fri, 01 Aug 2003 00:24:17 -0400
Newsgroups gmane.comp.java.jgenerator.devel
Organization JZox, Inc.
Message-ID <[email protected]>
> i tried scale an existing swf file. i changed XSCALE and YSCALE 
> properties, creating by an ActionScript; but there is no effect.
> code is the following:
> 
> ---------------
> 
> FlashFile flashFile = FlashFile.parse(swfInName);
> // enlarge 4x
> // set size of movie
> flashFile.setFrameSize(new Rect(0, 0, width*20*4, height*20*4));
> // scale 4x
> Program program = new Program();
> program.push("_root");
> program.push(Program.PROP_XSCALE);
> program.push(400);
> program.setProperty();
> program.push("_root");
> program.push(Program.PROP_YSCALE);
> program.push(400);
> program.setProperty();
> flashFile.getMainScript().getFrameAt(0).addFlashObject(new 
> DoAction(program));
> // write result
> generateFlash(swfOutName, flashFile);
> 
> ---------------
> 
> what is your opinion, what did i wrong?

Do the following. Create your actionscript in flash (just create empty 
movie and put your actionscript which sets the properties there). Export 
it to .swf (say test.swf). Then run jgenerate -dump test.dump test.swf. 
Now look what kind of byte code was created by flash (look inside 
test.dump). Then do the same using jgenerator actionscripting api. I 
recommend using ASAssembler because it simplifies creating nontrivial 
actionscript bytecode a lot.

-- 
Dmitry Skavish



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01