Tips and Tricks
Code Engineering Topics

Generate ActionScript using Instant Generator

Visual Paradigm for UML and Smart Development Environment provides a feature named Instant Generator which allows to generate source from class model for different programming language. ActionScript, a language used in Adobe Flash and is one of the supporting languages of Instant Generator. The below steps are describing how to generate ActionScript from class model.

Classes and Relationships Modeling

Before the ActionScript generation, class model should be existed. Open an existing VP project or model classes and relationships.
generateactionscript_overview.jpg

Instant Generator Dialog

Instant Generator Dialog is the main user interface of Instant Generator which providing feature such as configuration, preview or generation. To open Instant Generator Dialog, click Tools > Instant Generator > Instant Generator... on top menu.
generateactionscript_menu_crop.jpg

Configuration for ActionScript Generation

For smooth generation, only few values are required to input.

  1. Select ActionScript in Language for ActionScript generation.
    generateactionscript_instantgeneratordialog_selectlanguage_crop.jpg

  2. Input Output Path for placing generated source file(s).
    generateactionscript_instantgeneratordialog_inputoutputpath_crop.jpg

  3. Select class(es) or package(s) which to be used for generation.
    generateactionscript_instantgeneratordialog_selectclasspackage_crop.jpg

ActionScript options

Each Language contains specify options. For editing those options, click Advance.
generateactionscript_instantgeneratordialog_advance_crop.jpg

generateactionscript_advanceoptiondialog_crop.jpg

Below table describes the ActionScript options.

Option name Description
Unnamed Attribute Name to be used when name is empty
Invalid Char Replacement Replace character for invalid character in name
Indentation Indentation text for generated result
Attribute Prefix Prefix of attribute
Local Variable Prefix Prefix of local variable
Parameter Prefix Prefix of parameter
Generate Association Operations Generate operations for association or not

Preview or Generate

In instant generator, it allows to preview the generation result before the actual generation.

  • For preview purpose, press Preview in Instant Generator Dialog.
    generateactionscript_instantgeneratordialog_preview_crop.jpg

    generateactionscript_previewdialog.jpg

  • For generate purpose, press Generate in Instant Generator Dialog.
    generateactionscript_instantgeneratordialog_generate_crop.jpg

    • ActionScript is generated in output path.
      generateactionscript_result.jpg

    • Press Close to close Instant Generator Dialog.
      generateactionscript_instantgeneratordialog_close_crop.jpg

Samples

Click on the link below to download:

Resources

 
 
Last modified: 2006/10/23 01:30
 
 
Home | Recent Topics | Highlights | UML Diagrams | Tips and Tricks | Object-Relational Mapping
visual-paradigm.com Home | Training Center | UML Center | VP Gallery | Discussion Forum | UML Open Directory