wow that came across as one big line with no breaks. i guess the good luck is in reference to being able to read it.

David Hunter wrote:
hi this is the calculation i used for something very similar. dynamic text 
layed out round a circle (picture attached), although it doesn't take into 
account re-registering it so it is top left registration:
function makeNames() {  for (var i:int=0; i<filmNames.length; i++) {         
filmHolders[i] = new MovieClip();               filmHolders[i].val = i;         
namesHolder.addChild(filmHolders[i]);           //              var degs:Number = 
i * 20;               var rads:Number = (degs * Math.PI) / 180;               var 
r:Number = 110;             var rx:Number = (r * Math.cos(rads));           var 
ry:Number = (r * Math.sin(rads));           // ...          filmHolders[i].x = rx; 
         filmHolders[i].y = ry;          filmHolders[i].rotation = i * 20;         
      //              var nameText:TextField = new TextField();               
nameText.text = filmNames[i];
                filmHolders[i].addChild(nameText);              //      }}
surely if you put each sprite you want around the circle inside a container 
sprite for each sprite then you can sort the registration out:
//container for "wheel" of spritesvar containAll:Sprite = new 
Sprite();addChild(containAll);
containAll.x = stage.stageWidth/2;containAll.y = stage.stageHeight/2;
function makeSprites(num:Number) {      //create your sprite and draw contents  
var mySprite:Sprite = new Sprite();     mySprite.graphics.beginFill(0xff0033);  
mySprite.graphics.drawRect(0,0,30,20);  mySprite.graphics.endFill();    //create a 
container for the sprite     var myContainer:Sprite = new Sprite();  
containAll.addChild(myContainer);       myContainer.addChild(mySprite); 
//re-register inside container  mySprite.x = -mySprite.width/2; mySprite.y = 
-mySprite.height/2;        //do calculations       var degs:Number = num * 20;     
var rads:Number = (degs * Math.PI) / 180;       var r:Number = 110;     var 
rx:Number = (r * Math.cos(rads));   var ry:Number = (r * Math.sin(rads));   
//apply calculations to container       myContainer.x = rx;     myContainer.y = 
ry;     myContainer.rotation = num * 20;}//run function a few timesfor(var i:int = 
0; i<16; i++) {   makeSprites(i);}
(i've also not eaten so its probably wrong and i've completely misunderstood 
what you're after!!!)
good luck,
david
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to