May 1, 2011

VASGen: Free ActionScript3 Code Generation from Violet UML

By in ActionScript, Flash platform

Analyzing someone else`s code can really be simplified by sketching UML diagrams. Drawing on paper is a little bit outdated and running enterprise solutions such as Rational Rose or Enterprise architect is not a proper way to do when the need is only to make sketches.

So there is opensource solution on the market that can be found very useful. It`s name is VasGen.

VioletUML is a simple, lightweight, and free (GPL) tool for generating UML diagrams.

The VASGen build adds the ability to export from a UML Class Diagram to a set of ActionScript3 code files.

Download Violet Actionscript 3 Generator

Tags: , ,

April 28, 2011

Date constructor

By in ActionScript, Flash platform, Flex

The Date() constructor takes up to seven parameters (year, month, …, millisecond) to specify a date and time to the millisecond. The date that the newly constructed Date object contains depends on the number, and data type, of arguments passed.

  • If you pass no arguments, the Date object is assigned the current date and time.
  • If you pass one argument of data type Number, the Date object is assigned a time value based on the number of milliseconds since January 1, 1970 0:00:000 GMT, as specified by the lone argument.
  • If you pass one argument of data type String, and the string contains a valid date, the Date object contains a time value based on that date.
  • If you pass two or more arguments, the Date object is assigned a time value based on the argument values passed, which represent the date’s year, month, date, hour, minute, second, and milliseconds.

If you pass a string to the Date class constructor, the date can be in a variety of formats, but must at least include the month, date, and year. For example, Feb 1 2005 is valid, but Feb 2005 is not. The following list indicates some of the valid formats:

  • Day Month Date Hours:Minutes:Seconds GMT Year (for instance, “Tue Feb 1 00:00:00 GMT-0800 2005″, which matches toString())
  • Day Month Date Year Hours:Minutes:Seconds AM/PM (for instance, “Tue Feb 1 2005 12:00:00 AM”, which matches toLocaleString())
  • Day Month Date Year (for instance, “Tue Feb 1 2005″, which matches toDateString())
  • Month/Day/Year (for instance, “02/01/2005″)

 

Adobe Help: Date

 

Tags: ,

April 14, 2011

How to debug Flex source code in FDT

By in FDT
FDT

FDT

Comparing to Flash Builder, FDT offers users new way of coding.Its quick fix feature allows you to code at speed of light, every aspect of IDE is customizable, apparat is natively supported, project templates allows you to reuse your favorite project organization and settings.FDT is more open to the community, bug fixes are carefully chosen from the ones that really matters to the developer and release cycle seems to be shorten comparing to Flash Builder.Android and IOS development is next target also with FDT team and more improvements can be expected.While there are so many great stuff there are also downsides and additional steps for configuration. While Flash Builder automatically detects source code of Flex framework, FDT offers same functionality but with one additional step (create linked resource)

It is quite simple, all you have to do is:

1.Create linked resource pointing to your Flex SDK

Window->Preferences->General->Workspace->Linked Resources

2.Add linked resource to your .project file


<linkedResources>
    <link>
        <name>FLEX_SDK</name>
        <type>2</type>
        <locationURI>FLEX_SDK</locationURI>
    </link>
</linkedResources>

* FLEX_SDK is the name of the linked resource

Clean your project and voila you can step through Flex source code when debugging your application.

Tags: ,

April 12, 2011

FXG to MXML Graphic converter

By in Flash platform, Flex

Recently i needed to import some Adobe Illustrator graphic to my Flex Project. Since I wanted to manipulate those graphic via Actionscript, importing  FXG  to Flex app was not enough, i needed MXML Graphic.

Here is great app from David Deraedt that saved me a day

http://www.dehats.com/projets/fxg2mxmlg/FXG2MXMLG.html

 

Tags:

April 8, 2011

Introduction to using the drawing API

By in ActionScript, Flex
  • Anchor point: One of the two end points of a quadratic Bézier curve.
  • Control point: The point that defines the direction and amount of curve of a quadratic Bézier curve. The curved line never reaches the control point; however, the line curves as though being drawn toward the control point.
  • Coordinate space: The graph of coordinates contained in a display object, on which its child elements are positioned.
  • Fill: The solid inner portion of a shape that has a line filled in with color, or all of a shape that has no outline.
  • Gradient: A color that consists of a gradual transition from one color to one or more other colors (as opposed to a solid color).
  • Point: A single location in a coordinate space. In the 2-d coordinate system used in ActionScript, a point is defined by its location along the x axis and the y axis (the point’s coordinates).
  • Quadratic Bézier curve: A type of curve defined by a particular mathematical formula. In this type of curve, the shape of the curve is calculated based on the positions of the anchor points (the end points of the curve) and a control point that defines the amount and direction of the curve.
  • Scale: The size of an object relative to its original size. When used as a verb, to scale an object means to change its size by stretching or shrinking the object.
  • Stroke: The outline portion of a shape that has a line filled in with color, or the lines of an un-filled shape.
  • Translate: To change a point’s coordinates from one coordinate space to another.
  • X axis: The horizontal axis in the 2-d coordinate system used in ActionScript.
  • Y axis: The vertical axis in the 2-d coordinate system used in ActionScript.

Find out more:

Adobe Help: Basics of using the drawing API

 

Tags: , ,

August 5, 2010

Deferred method invocation

By in ActionScript

Very interesting thing about Actionscript 3 is that you can do very cool stuff with just a few lines of code.

For example, lets take a look at the top level package class Function and it`s apply method.

Specifies the value of thisObject to be used within any function that ActionScript calls.This method also specifies the parameters to be passed to any called function.Because apply() is a method of the Function class, it is also a method of every Function object in ActionScript.The parameters are specified as an Array object,unlike Function.call(), which specifies parameters as a comma-delimited list. This is often useful when the number of parameters to bepassed is not known until the script actually executes.

Read the rest of this entry »

Tags: , ,

Switch to our mobile site