Re: [Flashcoders] My Star
On Wed, Mar 3, 2010 at 10:54 AM, Karina Steffens wrote: > Hi Susan, > > You need to recheck your coordinates - if you remove the line: > star.graphics.moveTo(startPosX + factor*144, startPosY + factor*277); > > - you'll see a weird shape on the stage. So your error lies somewhere in > the > numbers, not the class structure. > Caught it. Thanks. Susan ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] My Star
Hi Susan, You need to recheck your coordinates - if you remove the line: star.graphics.moveTo(startPosX + factor*144, startPosY + factor*277); - you'll see a weird shape on the stage. So your error lies somewhere in the numbers, not the class structure. Cheers, Karina > -Original Message- > From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders- > boun...@chattyfig.figleaf.com] On Behalf Of Susan Day > Sent: 03 March 2010 2:10 > To: Flash Coders List > Subject: [Flashcoders] My Star > > Hi; > > I have the following code: > > package > { > import flash.display.MovieClip; > public class Star extends MovieClip > { > public function Star() > { > var startPosX:int = new int(); > var startPosY:int = new int(); > var factor:Number = new Number(); > startPosX = 100; > startPosY = 500; > factor = 0.07; > var star:MovieClip = new MovieClip(); > addChild(star); > star.graphics.lineStyle(1, 0xFF); > star.graphics.beginFill(0xFF); > star.graphics.moveTo(startPosX + factor*144, startPosY + factor*277); > star.graphics.lineTo(startPosX + factor*188, startPosY + factor*184); > star.graphics.lineTo(startPosX + factor*288, startPosY + factor*170); > star.graphics.lineTo(startPosX + factor*216, startPosY + factor*98); > star.graphics.lineTo(startPosX + factor*232, startPosY + factor*0); > star.graphics.lineTo(startPosX + factor*144, startPosY + factor*47); > star.graphics.lineTo(startPosX + factor*55, startPosY + factor*1); > star.graphics.lineTo(startPosX + factor*72, startPosY + factor*100); > star.graphics.lineTo(startPosX + factor*0, startPosY + factor*170); > star.graphics.lineTo(startPosX + factor*99, startPosY + factor*184); > star.graphics.endFill(); > } > } > } > > I created an empty *.fla to test and entered class "Star" (the name of > this > *.as) in the Properties. The stage is 1000*500. It doesn't draw my > star! > Now, I tested this in another *.as file before I pulled it out to > create its > own class and it worked. I added a trace at the end of the class when > it > failed in my test fla and it traced. What gives? > TIA, > Susan > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] My Star
Hey Susan, this work Code: //-- Save as Star.as -- package { import flash.display.MovieClip; public class Star extends MovieClip { public function Star(where) { var startPosX:int; var startPosY:int; var factor:Number; startPosX=0; startPosY=0; factor=0.07; var star:MovieClip=new MovieClip; star.graphics.lineStyle(1,0xFF); star.graphics.beginFill(0xFF); star.graphics.moveTo(startPosX + factor * 144,startPosY + factor * 277); star.graphics.lineTo(startPosX + factor * 188,startPosY + factor * 184); star.graphics.lineTo(startPosX + factor * 288,startPosY + factor * 170); star.graphics.lineTo(startPosX + factor * 216,startPosY + factor * 98); star.graphics.lineTo(startPosX + factor * 232,startPosY + factor * 0); star.graphics.lineTo(startPosX + factor * 144,startPosY + factor * 47); star.graphics.lineTo(startPosX + factor * 55,startPosY + factor * 1); star.graphics.lineTo(startPosX + factor * 72,startPosY + factor * 100); star.graphics.lineTo(startPosX + factor * 0,startPosY + factor * 170); star.graphics.lineTo(startPosX + factor * 99,startPosY + factor * 184); star.graphics.endFill(); where.addChild(star); } } } // --- end Code -- I create a fla whit next code in the first frame. /- Code import Star; var este=this; var estrella=new Star(este); stop(); /-End Code -- Enjoy It. On Wed, Mar 3, 2010 at 11:10 AM, Susan Day wrote: > Hi; > > I have the following code: > > package > { > import flash.display.MovieClip; > public class Star extends MovieClip > { > public function Star() > { > var startPosX:int = new int(); > var startPosY:int = new int(); > var factor:Number = new Number(); > startPosX = 100; > startPosY = 500; > factor = 0.07; > var star:MovieClip = new MovieClip(); > addChild(star); > star.graphics.lineStyle(1, 0xFF); > star.graphics.beginFill(0xFF); > star.graphics.moveTo(startPosX + factor*144, startPosY + factor*277); > star.graphics.lineTo(startPosX + factor*188, startPosY + factor*184); > star.graphics.lineTo(startPosX + factor*288, startPosY + factor*170); > star.graphics.lineTo(startPosX + factor*216, startPosY + factor*98); > star.graphics.lineTo(startPosX + factor*232, startPosY + factor*0); > star.graphics.lineTo(startPosX + factor*144, startPosY + factor*47); > star.graphics.lineTo(startPosX + factor*55, startPosY + factor*1); > star.graphics.lineTo(startPosX + factor*72, startPosY + factor*100); > star.graphics.lineTo(startPosX + factor*0, startPosY + factor*170); > star.graphics.lineTo(startPosX + factor*99, startPosY + factor*184); > star.graphics.endFill(); > } > } > } > > I created an empty *.fla to test and entered class "Star" (the name of this > *.as) in the Properties. The stage is 1000*500. It doesn't draw my star! > Now, I tested this in another *.as file before I pulled it out to create > its > own class and it worked. I added a trace at the end of the class when it > failed in my test fla and it traced. What gives? > TIA, > Susan > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] My Star
Hi; I have the following code: package { import flash.display.MovieClip; public class Star extends MovieClip { public function Star() { var startPosX:int = new int(); var startPosY:int = new int(); var factor:Number = new Number(); startPosX = 100; startPosY = 500; factor = 0.07; var star:MovieClip = new MovieClip(); addChild(star); star.graphics.lineStyle(1, 0xFF); star.graphics.beginFill(0xFF); star.graphics.moveTo(startPosX + factor*144, startPosY + factor*277); star.graphics.lineTo(startPosX + factor*188, startPosY + factor*184); star.graphics.lineTo(startPosX + factor*288, startPosY + factor*170); star.graphics.lineTo(startPosX + factor*216, startPosY + factor*98); star.graphics.lineTo(startPosX + factor*232, startPosY + factor*0); star.graphics.lineTo(startPosX + factor*144, startPosY + factor*47); star.graphics.lineTo(startPosX + factor*55, startPosY + factor*1); star.graphics.lineTo(startPosX + factor*72, startPosY + factor*100); star.graphics.lineTo(startPosX + factor*0, startPosY + factor*170); star.graphics.lineTo(startPosX + factor*99, startPosY + factor*184); star.graphics.endFill(); } } } I created an empty *.fla to test and entered class "Star" (the name of this *.as) in the Properties. The stage is 1000*500. It doesn't draw my star! Now, I tested this in another *.as file before I pulled it out to create its own class and it worked. I added a trace at the end of the class when it failed in my test fla and it traced. What gives? TIA, Susan ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders