Flash Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsWeb DesignFlash Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 4th, 2008, 02:26 AM
kalpsri kalpsri is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2007
Posts: 2 kalpsri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 52 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignFlash Development > Flash Component creating rectangle at runtime


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT