the morning, blah
I read your question wrong but you can still use what I showed you.
Your problem is you need to define the GraphicsExample in a /myProj/helper/GraphicsExample.as file
Peace, Mike
On 5/5/06, Michael Schmalle <[EMAIL PROTECTED]> wrote:
Your typing is incorrect
this;
var obj:DisplayObjec
should be
var obj:GraphicExample
so...
<mx:Script>
<![CDATA[
import helper.GraphicsExample;
import mx.core.UIComponent;
function clickHandler() {var obj:GraphicsExample= new GraphicsExample() as GraphicsExample;
var wrapper:UIComponent = new UIComponent();
addChild(wrapper);
wrapper.addChild(obj);
obj.doDrawCircle();
}
]]>
</mx:Script>
Try that,
Peace, Mike
On 5/4/06, fuzzoolia <[EMAIL PROTECTED] > wrote:In my mxml file i have this:
<mx:Script>
<![CDATA[
import helper.GraphicsExample;
import mx.core.UIComponent;
function clickHandler(){
var obj:DisplayObject = new GraphicsExample();
var wrapper:UIComponent = new UIComponent();
addChild(wrapper);
wrapper.addChild(obj);
obj.doDrawCircle();
}
]]>
</mx:Script>
<mx:Button label="Search" labelPlacement="bottom" click="clickHandler />
*******************************
in my actionscript file called helper.as i have this (in the same
directory):
package helper{
// ActionScript file
import flash.display.DisplayObject;
import flash.display.Graphics;
import flash.display.Shape;
import flash.display.Sprite;
import flash.util.trace;
public class GraphicsExample extends Sprite {
private var size:uint = 80;
private var bgColor:uint = 0xFFCC00;
private var borderColor:uint = 0x666666;
private var borderSize:uint = 0;
private var cornerRadius:uint = 9;
private var gutter:uint = 5;
public function doDrawCircle():void {
var child:Shape = new Shape();
var halfSize:uint = Math.round(size/2);
child.graphics.beginFill(bgColor);
child.graphics.lineStyle(borderSize, borderColor);
child.graphics.drawCircle(halfSize, halfSize, halfSize);
child.graphics.endFill();
addChild(child);
} //doDrawCircle Function
}//GraphicsExample
}//helper Package
I get the following errors still:
call to possibly undifined method 'GraphicsExample', what am I doing
wrong?
Cheers,
Shidan
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Web site design development Computer software development Software design and development Macromedia flex Software development best practice
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
--
What goes up, does come down.
--
What goes up, does come down.
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Web site design development | Computer software development | Software design and development |
Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.