-
1. Re: action script objects not displayed
Flashing Mathur Mar 29, 2011 12:33 PM (in response to Flashing Mathur)Adding my code snippets
The as file code
************
package secondPackage
{
import flash.display.*;
public class movingObject extends Shape
{
private var xPos:Number;
private var yPos:Number;
private var radius:Number;
private var color:uint;
public function movingObject()
{// currently a stub will use it later
}
public function drawcircleObj(xInput:Number,
yInput:Number,
radInput:Number,
colorInput:uint): void
{
xPos = xInput;
yPos = yInput;
radius = radInput;
color = colorInput ;
this.graphics.beginFill(color);
this.graphics.drawCircle(xPos,yPos,radius);
}
}*************************
The mxml file code
**********************************
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
creationComplete="initApp()">
<fx:Script>
<![CDATA[
import secondPackage.movingObject;
import flash.display.*;
private var myMoving:movingObject = new movingObject();
public function initApp():void
{
//show the string
myMoving.drawcircleObj(500,500,30,0xFF0000);
mainText.text = myMoving.letsStart();
}
]]>
</fx:Script>
<s:TextArea id="mainText" x="390" width="50" y="133"/>
<s:Button id="button1" x="804" y="227" label="Button" width="45"/>
</s:WindowedApplication>************
The problem which i suspect is that there should be a stage object holding the same object or circle created and then display it.
A faster reply will be highly appreciated. Thank you.
-
2. Re: action script objects not displayed
Drew747 Mar 29, 2011 8:52 PM (in response to Flashing Mathur)not exactly AIR but here it is in action:
http://www.trumpboston.com/graphics001/draw_circle.html
ok, so it is not a circle but you get the idea.
poached most of it from o'reilley (sp?)
app:
2ndPackage:


