Archive for the 'Tutorials' Category

Creating a product viewer

flash phone selectorWhen you want to create an animation to view your products, the flash player can give you a dynamic and excellent approach to achieving this. This little tutorial will show you the basics of creating an XML-based product viewer which can be reused by changing the content of the XML(of course). I refer to my post Loading external resources in Actionscript 3 in order to load images and How to load XML in Actionscript 3 before reading further. Below you will see the final result of the product viewer and the code to complete this tutorial. Read more »

Creating symbols and associative classes

When you create symbols in Flash CS3 and export them to Actionscript in the standard way, Flash generates a class representing the symbol. This is great when you want to access the symbol from the code. Every symbol you have created and is located in the library view can be exported to actionscript. If this is new to you, please recap on the article Understanding the use of designer objects in seperate as-file(class).

linkage_associative_class2

When you want to manipulate the symbol at runtime you would want to create your own class for the symbol. Read more »

How to load xml in Actionscript 3

If you have content stored in a database or in xml that is suitable for presenting in flash, then XML is one of many ways to give flash the content. Information stored in XML can be similar to this example:


<mobiles>
<mobile image="images/C905_product_quality_image_1.png" name="C905" />
<mobile image="images/G502_product_quality_image_1.png" name="G502" />
<mobile image="images/T650i_product_quality_image_1.png" name="T650i" />
<mobile image="images/W302_product_quality_image_1.png" name="W302" />
<mobile image="images/W350_product_quality_image_1.png" name="W350" />
<mobile image="images/W902_product_quality_image_1.png" name="W905" />
<mobile image="images/X1_product_quality_image_1.png" name="X1" />
<mobile image="images/z770i_product_quality_image_1.png" name="Z770i" />
</mobiles>

In order to get the XML content in flash you have to create a URLLoader and load the url where the XML is located. Here is an example how to get the attributes in the mobile node Read more »

Loading external resources into Actionscript 3

Images and flash movies(swf´s) are loaded into flash in a standard way, but when loading more than one image troughout your solution the handeling can be tough to manage in a good way. The standard way in loading resources is by using the Loader class and using the load method with the url as parameter. Here is an example:


var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressLoaded);
loader.load(new URLRequest(url));

When I create a movie I allways create a representing class to handle all loading of extenal resourses. The main reason is to not have to add the required Read more »

Icon carousel with XML support version 2 now in AS3

I previously posted a icon carousel written in as2, but wanted to do the same for as3. Both the AS2 and the AS3 version loaded an XML-file that was parsed to retrieve the content/images that should be viewed. This article explains the files needed with code to get the final result visualized below.

First and foremost we have to create the XML-file that holds the data. We do not need a XSD for this and it´s just rock´n roll. Read more »

Next Page »