Simple pet (ActionScript tutorial)

From Whirled Club Wiki
Jump to navigation Jump to search
ActionScript Tutorial
Create a smiple pet using AS3.
Difficulty Level
Beginner
Requirements
Icon-Programming.png ActionScript 3.0, Whirled SDK
Other Information
Next tutorial: Advanced pet (ActionScript tutorial)
Icon-highlighted-pet.png

This tutorial uses AS3 to build an pet for Whirled.


Prerequisites

  1. Setting up your programming environment

Set Up Your New Pet

To create a new pet, change to the whirled directory and run the ant newpet task:

  % cd whirled
  % ant newpet

Windows users can double click the newproject.bat file instead of using the command line.

If this is the first time you are using the SDK, it will ask you to configure the directory of your Flex SDK and your Flash Standalone Player. A dialog box will pop up allowing you to specify that information and then you will proceed to creating your new project.

<actionscript> XXX$ ant newpet Buildfile: build.xml

prepare-flex:

    [copy] Copying 1 file to /WhirledSDKs/0.34/whirled/etc
    [copy] Copying 1 file to /WhirledSDKs/0.34/whirled/etc

newpet: [newproject] Please enter the name of your Pet project. [newproject] For example, BestPetEver: EasyImagePet [newproject] Your main class will be called: [newproject] EasyImagePet.as [newproject] Is this OK? [y/n] y


</actionscript>

and the tool will do the rest for you: <actionscript>[newproject] Creating 'easyimagepet/build.xml'. [newproject] Creating 'easyimagepet/build.bat'. [newproject] Creating 'easyimagepet/EasyImagePet.as'. [newproject] Done! Your new project has been created in 'easyimagepet'. </actionscript>


Stub.gifThis article is a stub. You can help the wiki by expanding it.