Re: API Commands

Dmitry Skavish <[email protected]> Tue, 14 Oct 2003 14:08:02 -0400
Newsgroups gmane.comp.java.jgenerator.devel
Organization JZox, Inc.
Message-ID <[email protected]>
>          Util.init("../classes");
>          System.out.println("Starting TickerTest");
>          FlashFile file = FlashFile.newFlashFile(); // create default
> flash file
>          Script script = new Script(); // create main script with 1
> frame
>          script.setMain();
>          file.setMainScript(script); // set main script for the file
>          //int startFrame = 1;
>          //Frame frame = script.getFrameAt(1);
>          Frame frame = new Frame();

>          Instance instance = frame.addInstance(script, 1, null, null);

script here has to be new Script() for the instance, i.e. change it to

           Instance instance = frame.addInstance(new Script(), 1, null, null);

           GenericCommand command = new TickerCommand();
>          command.setInstance(instance);
> 
>          command.addParameter("datasource", "text.txt");
>          command.addParameter("orient", "horizontal");
>          command.addParameter("mask", "false");
>          command.addParameter("stepsize", "8");
>          command.addParameter("itemspace", "5");
>          command.addParameter("halign", "left");
>          command.addParameter("valign", "top");
>          command.addParameter("instancename", "");
> 
>          instance.setCommand(command);
>          StandardContext context = new StandardContext();
>          context.setValue("filename", "tickertest.swf");

you need to set values to the context only if you use variables in command 
parameters (variables things like {varname}), so no need to setValue here

if you got some exception then send the exception stacktrace as well.

-- 
Dmitry Skavish
\



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php