Re: API Commands

Dmitry Skavish <[email protected]> Mon, 13 Oct 2003 09:49:00 -0400
Newsgroups gmane.comp.java.jgenerator.devel
Organization JZox, Inc.
Message-ID <[email protected]>
> Is there any documentation or examples on how to use the commands.  I
> tried to use the TickerCommand class but when I run my test class I get
> an IVException: Error reading from the datasource '' in command
> TickerCommand.  What datasource, I never said anything about a data
> source.  The code I use is:
> 
> file = FlashFile.newFlashFile();
> StandardContext context = new StandardContext();
> Script script = new Script(1);
> script.setMain();
> file.setMainScript(script);
> TickerCommand ticker = new TickerCommand();
> ticker.doCommand(file, context, script, 1)

each command needs to be passed parameters. names and types of parameters depend on 
command. for example if you need to pass some parameter to some command do like the following:

context.setValue("datasource", "#name, value\n\"name1\", \"value1\"");
or
context.setValue("datasource", "c:/jgenerator/data/somedatasource.txt");

and by the way command has to be attached to an Instance object by setting instance on the 
command and by setting command on the instance. don't ask ahy it's done this way, the 
desing was pretty much dictated by Macromedia Generator architecture and the way it worked.

> None of the classes in the command package are documented, so if there
> is something else I am supposed to add to the context, I have no way of
> knowing what it is?  And anyone answering, please dont say "feel free to
> document them." Because documenting someone else code is an exercise in
> futility.

it's all "documented" in .def files (<jgenerator>/ext/templates/) and in corresponding 
chapters in Macromedia Generator documentation.

-- 
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