Showing posts with label Variable. Show all posts
Showing posts with label Variable. Show all posts

Saturday, August 29, 2009

ActionScript 3.0 Tutorial Slide. Hope it helps

Coding Flash : ActionScript(3.0) Tutorial

I use this slide to give an ActionScript 3.0 Tutorial in the freshman training course of Intelligent Agent Laboratory in Department of Computer Science and Information Engineering of National Taiwan University.

FYI.

Monday, June 29, 2009

Using Global Variable in Flex

 

1. Declare the global variable in the main .mxml file.

 

In the main .mxml file :

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="TryAS()">
    <mx:Script>
        <![CDATA[
            public var bookSize:Rectangle = new Rectangle(0,0,800,600);

            public function TryAS():void{
                trace("Hello World");
            }
       ]]>
    </mx:Script>
</mx:WindowedApplication>

2.Use Application.application.yourGlobalVariableName to access the variable.

 

In the .as class you write :

import mx.core.Application;

// Application.application.yourGlobalVariableName

Application.application.bookSize.width