|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Flash Component creating rectangle at runtime
I have created a component to draw a rectangle at runtime. In class file i written as
class com.math.Sample extends MovieClip { private var mcContainer:MovieClip; function setXY(xaxis:Number, yaxis:Number):Void { mcContainer._x = xaxis; mcContainer._y = yaxis; } public function Dialog() { } public function popupBox():Void { //background for pop-up window drawRoundedRectangle(160,110,20,0x993399,50); setXY(119,116); } //Draw rectangle background public function drawRoundedRectangle(boxWidth:Number, boxHeight:Number, cornerRadius:Number, fillColor:Number, fillAlpha:Number):Void { var d:Number = _root.getNextHighestDepth(); mcContainer = _root.createEmptyMovieClip("container"+d, d); mcContainer.beginFill(fillColor,fillAlpha); mcContainer.moveTo(cornerRadius,0); mcContainer.lineTo(boxWidth-cornerRadius,0); mcContainer.curveTo(boxWidth,0,boxWidth,cornerRadi us); mcContainer.lineTo(boxWidth,cornerRadius); mcContainer.lineTo(boxWidth,boxHeight-cornerRadius); mcContainer.curveTo(boxWidth,boxHeight,boxWidth-cornerRadius,boxHeight); mcContainer.lineTo(boxWidth-cornerRadius,boxHeight); mcContainer.lineTo(cornerRadius,boxHeight); mcContainer.curveTo(0,boxHeight,0,boxHeight-cornerRadius); mcContainer.lineTo(0,boxHeight-cornerRadius); mcContainer.lineTo(0,cornerRadius); mcContainer.curveTo(0,0,cornerRadius,0); mcContainer.lineTo(cornerRadius,0); mcContainer.endFill(); } } I called this class file in my fla. Untill this part, my program working fine. After then i have created swc and mxp file. Using swc and mxp this component is not creating the rectangle at runtime. Please tell me what is wrong with this code. |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Flash Development > Flash Component creating rectangle at runtime |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|