Placing 8 objects on stage in a circle

Hi,
Need some help placing 8 150X150 circles on stage at equidistant locations around a larger circle (644X644, line width 4, centered on stage). Stage is 750X750.
This is not dynamically drawn in runtime. Simply getting the correct coordinates for the 8 circle objects to place them around the 644X644 circle.
Have tried to do it with snapping, grid, by rough estimate, all with poor results. There must be a better way to determine the correct coordinates.
Any help appreciated.
Regards,

Even though you want to do it by hand you really should just use code, it's far more precise.
Here's an example demoing Kglads code that should help you understand how it works. All you have to do is modify what is being positioned in the loop. I'm generating a small black circle just for example.
Open a new AS3 doc and paste this in frame 1's script:
import flash.display.Sprite;
var xCenter:int = int(stage.stageWidth / 2);
var yCenter:int = int(stage.stageHeight / 2);
var cirRadius:int = 100;
for (var i:int = 0; i < 8; i++)
    // generating a black circle
    var c:Sprite = new Sprite();
    c.graphics.beginFill(0x0,1);
    c.graphics.drawCircle(-10,-10,10);
    c.graphics.endFill();
    addChild(c);
    c.x = xCenter + cirRadius * Math.cos(i*Math.PI/4)
    c.y = yCenter + cirRadius * Math.sin(i*Math.PI/4)
For you, you can keep an array of references to objects you want to position and use that. The code would change like this (expecting these objects to be on the stage, item_1, item_2, etc):
var xCenter:int = int(stage.stageWidth / 2);
var yCenter:int = int(stage.stageHeight / 2);
var cirRadius:int = 100;
// array of objects to reposition (must be on stage, change names to what you want)
var objs:Array = [item_1, item_2, item_3, item_4, item_5, item_6, item_7, item_8];
for (var i:int = 0; i < 8; i++)
    objs[i].x = xCenter + cirRadius * Math.cos(i*Math.PI/4)
    objs[i].y = yCenter + cirRadius * Math.sin(i*Math.PI/4)
If you want to specify the angles around the circle yourself, make another array with those:
var xCenter:int = int(stage.stageWidth / 2);
var yCenter:int = int(stage.stageHeight / 2);
var cirRadius:int = 100;
// array of objects to reposition (must be on stage, change names to what you want)
var objs:Array = [item_1, item_2, item_3, item_4, item_5, item_6, item_7, item_8];
// angles of each item desired
var desiredAngles:Array = [0,45,90,135,180,225,270,315];
for (var i:int = 0; i < 8; i++)
    objs[i].x = xCenter + cirRadius * Math.cos(desiredAngles[i] * (Math.PI/180));
    objs[i].y = yCenter + cirRadius * Math.sin(desiredAngles[i] * (Math.PI/180));
You don't need to loop over the objects, you can manually write each one if you want if that's easier of course..
// circles center at 300px, 100px radius, angle 90
someClip_mc.x = 300 + 100 * Math.cos(90 * (Math.PI/180));
someClip_mc.y = 300 + 100 * Math.sin(90 * (Math.PI/180));

Similar Messages

  • Resolved reference placed in object with no cache

    Hi ,
    I have been seeing this error in my weblogic logs.The workflows are
    running fine and doing intended work. Have a look at the error message
    WARNING: Resolved reference placed in object with no cache.
    java.lang.Exception: printStackTrace
            at com.waveset.util.Util.printStackTrace(Util.java:6259)
            at com.waveset.object.PersistentObject.cacheWarning(PersistentObject.java:476)
            at com.waveset.object.PersistentObject.checkReference(PersistentObject.java:2683)
            at com.waveset.object.PersistentObject.checkReferences(PersistentObject.java:2718)
            at com.waveset.object.PersistentObject.addMemberObjectGroup(PersistentObject.java:1513)
            at com.waveset.workflow.WorkflowEngine.buildWorkItem(WorkflowEngine.java:4406)
            at com.waveset.workflow.WorkflowEngine.callManualAction(WorkflowEngine.java:4284)
            at com.waveset.workflow.WorkflowEngine.callAction(WorkflowEngine.java:3811)
            at com.waveset.workflow.WorkflowEngine.callAction(WorkflowEngine.java:3229)
            at com.waveset.workflow.WorkflowEngine.execute(WorkflowEngine.java:3070)
            at com.waveset.workflow.WorkflowEngine.makeTransition(WorkflowEngine.java:2809)
            at com.waveset.workflow.WorkflowEngine.checkExplicitTransitions(WorkflowEngine.java:2700)
            at com.waveset.workflow.WorkflowEngine.checkTransitions(WorkflowEngine.java:2486)
            at com.waveset.workflow.WorkflowEngine.processSteps(WorkflowEngine.java:1891)
            at com.waveset.workflow.WorkflowEngine.walkCases(WorkflowEngine.java:1748)
            at com.waveset.workflow.WorkflowEngine.walkCases(WorkflowEngine.java:1656)
            at com.waveset.workflow.WorkflowEngine.execute(WorkflowEngine.java:816)
            at com.waveset.workflow.WorkflowEngine.execute(WorkflowEngine.java:478)
            at com.waveset.workflow.WorkflowExecutor.execute(WorkflowExecutor.java:235)
            at com.waveset.task.Scheduler.execute(Scheduler.java:2393)
            at com.waveset.task.Scheduler.executeTask(Scheduler.java:2295)
            at com.waveset.task.TaskManager.executeTask(TaskManager.java:277)
            at com.waveset.workflow.Workflow.checkinWorkItem(Workflow.java:378)Any Ideas,
    Thanks

    Did anybody resolve this issue?
    I am getting com.waveset.util.WavesetException:Class com.omd.session.WorkflowServices not found.
    It seems the workflow status shows finished, but did not start the acctual workflow process of approvals and emails to the appropriate user accounts.
    Anybody has any clues about this exception?
    G

  • Placing a Object in Cookie

    Hi,
    I have a class named Test I placed the object of Test inside a session and try to take it in a other JSP
    of same Session
    <%
    Test t = new Test();
    session.putValue("obj",t);
    %>
    how to take the object t in the next page (with the code please)
    Thanks in advance

    how I can transfer the Test object to the other page
    Because I dont want to instantiate it there(in the
    other page)Well, since you already placed your object into the session, how about just retrieving it from there?

  • Adobe Custom Commands:Finding Objects on Stage

    I want to find out how to find objects on stage in order to change their names, using actionscript in run commands. Anybody have any ideas/methods?

    You can make use of getChildAt() method from Stage class.
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayOb jectContainer.html#getChildAt()

  • Placing an array of objects onto stage

    I am trying to place an array of objects onto a stage where they drop vertically. I have been able to do it by placing the array objects into an object called "bag" but have found that the bag object only contains the last array object id so I can not apply actions to various array objects.
    Also my objects do not loop and only appear once.
    Below is the code so far.
    var tempArray:Array = new Array(); // Stores randomised values
    var bagArray:Array = new Array("gslow_id","gshigh_id","glow_id","ghigh_id","gdiv_id",
      "gcall_id","gbust_id","gbull_id","gboom_id","gbear_id"); // List of bag names
    function createBags() {
    if (tempArray.length == 0) { // check if array is empty
         for (var i:Number = 0; i < targets; i++) { // for loop - creat variable bagName to the value of targets
         var bagName: String = bagArray[i];
         var depthLevel:Number = this.getNextHighestDepth();
         // attach movies to time line
         this.attachMovie(bagName, bagName, depthLevel, {_x:random(350) + 100, _y:random(0) + spacing});
         spacing += 45;
         tempArray.push(bagName);
         //trace(tempArray);
         bag = _root[bagName]; // create a bag object contain the bagName variable
         //trace (bag);
         bag.onEnterFrame = function() {
              if (this._x < 570 && this._y > 0) {
              this._y += speed * random(8);
              } else {
              this._x = random(500);
              } // end if (this._x < 570 && this._y > 0)
         } // end bag.onEnterFrame ()
    bag.onPress = function() {
    // if bag is pressed select action
    //trace (bag); 
    xPos = this._x
    yPos = this._y
    unloadMovie(this);
    score += 1000
    scoreText_txt.text = score;
    //trace(score);
    checkScore();
    } // end bag.onPress ()
    //trace(targets);
    //trace(bagName);
    } // end for (var i:Number = 0; i < targets; i++)
    } // end if (tempArray.length == 0)
    } // End createBags()

    try:
    var bagA:Array=[];
    var bagArray:Array = new Array("gslow_id","gshigh_id","glow_id","ghigh_id","gdiv_id",
      "gcall_id","gbust_id","gbull_id","gboom_id","gbear_id"); // List of bag names
    function createBags() {
    if (tempArray.length == 0) { // check if array is empty
         for (var i:Number = 0; i < targets; i++) { // for loop - creat variable bagName to the value of targets
         var bagName: String = bagArray[i];
         var depthLevel:Number = this.getNextHighestDepth();
         // attach movies to time line
         var bag:MovieClip = this.attachMovie(bagName, bagName, depthLevel, {_x:random(350) + 100, _y:random(0) + spacing});
      bagA.push(bag);
         spacing += 45;
         //trace (bag);
         bag.onEnterFrame = function() {
              if (this._x < 570 && this._y > 0) {
              this._y += speed * random(8);
              } else {
              this._x = random(500);
              } // end if (this._x < 570 && this._y > 0)
         } // end bag.onEnterFrame ()
    bag.onPress = function() {
    // if bag is pressed select action
    //trace (bag); 
    xPos = this._x
    yPos = this._y
    unloadMovie(this);
    score += 1000
    scoreText_txt.text = score;
    //trace(score);
    checkScore();
    } // end bag.onPress ()
    //trace(targets);
    //trace(bagName);
    } // end for (var i:Number = 0; i < targets; i++)
    } // end if (tempArray.length == 0)
    } // End createBags()

  • Aligning objects on stage throughout timeline

    I am new to Flash and am probably missing the obvious.
    I want to select objects on the stage and move them to a new
    position, or align them to a guide line. However, I want to do this
    for a whole series of frames in the timeline. In essence, select
    all frames in the timeline, and then select all objects on the
    stage, and align them to the left side and top side.
    However, it seems to only align objects in the current frame.
    I started with one circle on stage, then added more keyframes
    in the timeline, changing the color of the fill at different
    keyframes.
    Is there another way to do what I want?
    Thanks,
    Patrik

    I found it...Edit Multiple Frames.

  • Need help placing people / objects into another photo ...realistically

    Hi, I've been a Photoshop user for many years now and have adopted CS4 when it initially came available. My photoshop skills are to a good standard however one thing I always find difficult is taking a selection from one photo (usually a person / object) and placing it into another photo.
    I am able to correct the size and scale and maintain the aspect ratio but I never seem to be able to make the photo look convincing, I know this is a basic part of Photoshop, but I was wondering if any of you could offer some tips or advice on how to make the person / object more realistic and hopefully so that clients won't be able to spot it was missing in the first place.
    Thanks in advance

    The Daily show is a satirical show in the US with John Stewart. As a kind of running joke on "Photoshopped", they often badly photoshop things together, cut and paste style.
    Whether things will ever look correct, is to do with LIGHT. The light on your background has to be the same as the light on your foreground subjects. Color can be easily tweaked and matched but light cannot. Photographers with the right expertise (thinner on the ground than you might think) can look at the light in a destination image, and try and match in the studio, but this is a highly skilled area. I once had a professional job where someone had taken David Beckham to a studio - and they wanted the images realistically comped into beach scenes, with broad sunshine, resulting hard shadows, sunsets and horizons. Unfortunately the photographer was obviously more interested in having fun with a high profile client like Beckham for their book, than they were in lighting correcty for the intended destination images.  Impossible without weeks of painting, and I told them. No point in wasting clients time on images like this.

  • Placed Illustrator object with tint turning solid in RIP

    I have a file i need to output from IDCS2. It has a company logo that is made up of 2 spot colors (ai file). There is another placed object, also an ai file that uses a 10% tint of one of the colors in the logo.
    When the file goes through our Scitex RIP the 10% tint comes out solid (100% of the pantone color).
    Our RIP is old (PS/M 6.1) but usually does not give us this problem.
    I've tried multiple different ways to make this file work, --using the tinted file as an eps, pdf, making it an object in ID, but nothing works. (I can get it to work if I change colors to one of process colors in Illustrator --e.g, making one spot Cyan and other magenta-- but this is cumbersome.
    Anyone have a suggestion

    I have had at very similar problem with my Star 600 L2 rip, but only if the IDCS2 postscript is first imposed in Preps. The problem does not occur printing to the rip directly from IDCS2 to the rip, and it does not occur at all from IDCS. Not quite the same as your problem.
    In my case I was able to solve it by saving the AI.eps as AI.pdf and relinking to that in ID (all versions). This was for Device Independent postscript out of ID and In-RIP separations out of Preps.
    So try a pdf file instead of eps.
    Al
    Edit: You may also want to have a look at this: http://www.rti-rips.com/Imagesetter%20RIP-Kits.html

  • Placing an object/file in defalut host root folder

    Hi All,
    I am facing a problem in placing a MIME object i.e. a XML file in the root folder.
    I have written a FLEX application which sends a request for a particular file in the root folder.
    It attempts to access the following link.
    http://mysap.xyz.com/crossdomain.xml
    I want to place this crossdomain.xml file in the root folder.
    Can I do it by using some transactions in SAP or it has to be done at the OS level.
    I tried uploading the file from MIME Repository and looked around in the SICF transaction, but with no success.
    Regards,
    Ameya

    Have a look at this thread: crossdomain.xml on WAS
    Kind regards,
    Roland

  • Change stacking order of placed images/objects?

    Hello All,
    Is it possible to change the order of placed images in a PDF?
    I have a PDF with several objects in it, I want to be able to place an image into the PDF, and have it appear behind some of the objects and in front of others... is this possible?
    Example, let's say I have a PDF with a cartoon/comic word or thought bubble in it... I want to be able to place an image of my friend behind the word bubble object.
    I have Acrobat 9.0 Pro
    Thanks!

    As far as AS3 goes, I don't know what you mean, but it can be used pretty much the same way you use AS2, with the exception that in AS3 you cannot place code "on" object like you can in AS1/AS2... all code must be on the timeline.  Beyond that, there is no difference beyond alot of the code being different between the two languages.  The timeline remains as a place to build things in if you choose to.
    As far as your question goes, yes, you can have a rollover of a movieclip assign text to a textfield within it.  Let's say you're using AS2 and you have a movieclip named "button1" that contains a textfield named "tf1".  Code for that could be...
    button1.onRollOver = function(){
         button1.tf1.text = question1;
    And if you wanted to make tit so that clicking that same button shows the answer....
    button1.onRelease = function(){
         button1.tf1.text = answer1;

  • SWFLoader - SWF showing objects outside stage

    Hi... I have a SWF that I am loading with SWFLoader. For some
    reason, all of the elements that are outside the stage in the SWF
    (animated objects) are showing in Flex. How do I only show the SWF
    as it is supposed to be seen? I have set height and width on both
    the SWF and a container canvas.

    You need to create a rectangle that's exactly the same size
    as your document / stage, and make it a mask and put all of the
    layers in the document underneath it. That should take care of
    it.

  • Target object on stage from within Class

    Hi,
    I have a custom class which uses some buttons on the stage. Or at least is trying to.
    say have this code in the customClass.as file
    package{
         import flash.events.*;
         import flash.display.MovieClip
         public class customClass{
              public function customCLass (){
                   btn.addEventListener(MouseEvent.MOUSE_OVER , btnOVER);
              private function btnOVER (e:MouseEvent):void{
                  btn.gotoAndStop('over');
    The Lines marked in red throw me this kind of error:
    1120: Access of undefined property btn.

    I am creating the class in a sepparate file.
    when i create an object in this class i pass another object to the class from the timeline. That returns no errors.
    I create objects from the timeline like this:
    var object:customClass = new customClass();

  • Change in Text Attibutes with Placed Illistrator Object

    I don’t know if this has been addressed but I am having problems with placing an Illustrator object into an InDesign document.  When I place an Illustrator CS6 object into am InDesign CS6 document the text attributes change.  The fonts becomes bolder but only for the spread where the Illustrator is placed and when the document is exported as a pdf file you still see bolder text for the two pages in the spread.  This seems to be a problem with CS6 since I never saw this problem with previous versions.  It does not matter how you place the Illustrator file either through place command or dragged from Bridge you still see the change.  The strange thing it is only with certain Illustrator files because it does happen all the time. Is there something about the Illustrator file that is causing the problem?

    "emboldening" of text on pages with transparency is a well-known problem. You can try the stacking tricks, but they usually don't help for on-screen output. The only thing I've ever seen suggested that would make all pages look the same, albeit with the darker text, is to put a transparent object on every page, usually easily accomplished by adding something in the margin on the master page.

  • Looping through objects on stage

    I know I've done this type of thing before, but I can't
    remember how... How do I loop through all the objects on a stage to
    check their names for a specific substring. On my stage I have a
    number of movieclips with names that end with either _a_mc or
    _b_mc. I want to check for everything that has _a_mc so I can
    change the frame of that movieclip.

    The for...in loop should be handy for this:
    for (var obj in _root){
    trace( obj + ": " + _root[obj] );
    greets,
    blemmo

  • Placing an object/photo over gutter in two page layout in Pages???

    So here's my issue. I'm new to pages and need all the help I can get. I have a two page layout and I'm trying to place a large photo across the gutter so that it will show on both pages. It will let me create the object and place a picture in it but it disappears on the other page. What am I not doing? Thanks for your help!
    mrs.rodgers

    Welcome to the forums, mrs. rodgers.
    Do you mean you have an actual two page layout (with "Facing Pages" selected in the Document Inspector)? If so (and it's not just a two column layout on one page), then there is unfortunately no way to set a picture to span two pages automatically.
    Your best bet is to fake the effect by placing two copies of the picture, one on each side of the gutter, with appropriate masks set on each, so that the left page has the left side of the picture, and the right page has the right side. Do note, however, that most printers won't print right to the edge of the page (so-called "borderless" or "full-bleed" printing), and so it may not turn out exactly as you desire.

Maybe you are looking for

  • ADF in Jdev 10.1.3.2 - Wrong Page Opens When "Open Link in New Window" Used

    We are former Oracle Forms/Reports developers and Struts developers in the early stages of a new project using ADF in JDeveloper 10.1.3.2. We are all new to this development environment (though not new to Java), so apologies in advance if this is tri

  • IDoc error while running CO88

    Hello everyone, I get the following error while running CO88, I have a feeling it may have to do with the reverse posting I did earlier. FI/CO interface: Line item entered several times Message no. RW014 Diagnosis The following document information w

  • Macbook pro occasionally doesnt charge until powered off

    My late 2011 macbook pro running the latest version of mountain lion, occasionally wont charge untill powered off. I checked the battery health and its normal. I have the battery health app installed and it has 97.1% of its capacity availabe. Could t

  • Company wide spend

    Hi Gurus, is there a report i can run to mee the following need: we just need goods issues only for stock items &  goods receipts for non-stock purchases for a given period of time accors all plants of the company. We are not looking for anything to

  • Printing Image PB51 IPL / C#

    Hi guys! I'm new in this bussiness, and I was wondering If anyone here can help me.  I have an Intermec PB51 - IPL. I'm developing a Windows Mobile Apllication (C#) that connects to the printer by bluetooth. I already connect to the printer and print