I want to use the new graphics declarations to draw a bunch of 5px wide circles onto this canvas

I'm learning this FB 2 IDE.
Could someone help me out here for a project I want to do.
Basically what I have is this
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:mx="library://ns.adobe.com/flex/halo" layout="absolute" minWidth="1024" minHeight="768" width="432" height="382">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <mx:Canvas width="100%" height="100%" backgroundColor="#FFFFFF">
    </mx:Canvas>
</mx:Application>
I want to use the new graphics declarations to draw a bunch of 5px wide circles onto this canvas but I don't know how. I want to evalve this into a strategy game
Any code tips would be appreciated
Is Canvas the best choice to draw stuff onto?
looking forward to your input and help as this app grows

Thanks very much so far, awesome code:)
I now have added some animation and logic.
If compile this and press start animation you will see what I mean
I would now like to draw a line from every gray ellipse to every blue ellipse but am not sure of the best way to do this using fxg.(connecting centers and behind the ellipsis)
Would love some expert advice
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/halo">
    <s:creationComplete>
        <![CDATA[
        setupScene();
        ]]>
    </s:creationComplete>
    <s:controlBarContent>
        <s:Button label="start Animation"
                  buttonDown="startAnimation();" />
        <s:Button label="stop Animation"
                  buttonDown="stopAnimation();" />
    </s:controlBarContent>
    <fx:Script>
        <![CDATA[
            import mx.collections.ArrayCollection;
            import mx.core.IVisualElement;
            import mx.graphics.SolidColor;
            private var FPS:uint = 20;
            private var delay:uint = 1000/ FPS;
            private var repeat:uint = 100;
            private var myTimer:Timer = new Timer(delay, repeat);
            private var blueTeam:ArrayCollection =  new ArrayCollection();
            private var blueLeaders:ArrayCollection =  new ArrayCollection();
            private function startAnimation():void{
                myTimer.addEventListener("timer", updateState);
                myTimer.start();
            private function stopAnimation():void{
                myTimer.stop();
            protected function setupScene():void {
                for (var i :int = 0;i< 8;i++){
                    var c:bCirc = new bCirc();
                    c.x = uint(Math.random() * 400); // random X position
                    c.y = uint(Math.random() * 300); // random Y position
                    blueTeam.addItem(c);
                for (i = 0;i< 2;i++){
                    var c2:bLeader = new bLeader();
                    c2.x = uint(Math.random() * 400); // random X position
                    c2.y = uint(Math.random() * 300); // random Y position
                    blueTeam.addItem(c2);
            private function updateState(event:Event):void{
                for each (var o:IVisualElement  in blueTeam ){
                    o.x ++;
                for each (o  in blueLeaders ){
                    o.x ++;
                render();
            private function render():void{
                //clear all items from displaylist
                removeAllElements();
                for each (var o:IVisualElement in blueTeam ){
                    addElement(o );
        ]]>
    </fx:Script>
    <fx:Declarations>
        <fx:Component className="bCirc">
            <s:Ellipse width="30" height="30" alpha="0.8">
                <s:fill>
                    <s:SolidColor color="0x0000ff" />
                </s:fill>
            </s:Ellipse>
        </fx:Component>
        <fx:Component className="bLeader">
            <s:Ellipse x="0" y="0" width="30" height="30">
                <s:fill>
                    <s:LinearGradient x="0" y="0" rotation="90">
                        <s:entries>
                            <s:GradientEntry color="#FFFFFF" ratio="0" alpha="1" />
                            <s:GradientEntry color="#000000" ratio="1" alpha="1" />
                        </s:entries>
                    </s:LinearGradient>
                </s:fill>
            </s:Ellipse>
        </fx:Component>
        <fx:Component className="RCirc">
            <s:Ellipse width="30" height="30" alpha="0.8">
                <s:fill>
                    <s:SolidColor color="0xff0000" />
                </s:fill>
            </s:Ellipse>
        </fx:Component>
    </fx:Declarations>
</s:Application>

Similar Messages

  • How can I find my serial number for Adobe Acrobat 11. I got a new iMac and I don't want to use the new version at £18.00 per month. I don't need it. Thank you

    I used to use CS5 and I want to use the Acrobat version on my new iMac.
    How can I find my serial number for Adobe Acrobat 11.  I don't want to use the new version at £18.00 per month. I don't need it. Thank you

    Hi Anthony Aduhene
    Please refer : Find your serial number quickly

  • I have two iPads. With two functioning iPads. Is it possible (on the same ID) to sync two of them differently with the same account. So I want to use the new iPad for all my current functions. The old iPad for just my music collection?

    I have two iPads. With two functioning iPads. Is it possible (on the same ID) to sync two of them differently with the same account. So I want to use the new iPad for all my current functions. The old iPad for just my music collection and remove all the other stuff?

    Very easily. I have an iPod touch and iPad on the same account with totally different content.
    If you use iTunes, connect each iPad to your computer and open iTunes and deselect any automatic updating/syncing. If you don't sync with iTunes but have them set up independently, under the settings, App Store, turn off automatic downloads for apps, etc.
    I'm old fashioned, I set up and sync my iPad and iPod to my computer and iTunes. Each device has a different name  and I manage content manually and only allow sharing on what I want shared.

  • Ive lost my apple ID for my ipod, now i have an iphone and i want to use the same apple ID for both can someone tell me how to do this

    I have lost my apple ID for my ipod, now ive got a new iphone and i want to use the same ID for both, can anyone one tell me how to do this? ( i no my ID for the iphone)

    Just use the same ID.
    These may alos help:
    How to use multiple iPods, iPads, or iPhones with one computer
    What is the best way to manage multiple...: Apple Support Communities

  • Want to buy the new MacBook Air 13in i5 processor, but I have to know if this will run RuneScape on high quality SMOOTHLY. Thank you

    Want to buy the new MacBook Air 13in i5 processor, but I have to know if this will run RuneScape on high quality SMOOTHLY. Thank you

    I can say World of Warcraft runs smooth.

  • Hello, I want to use the new tab feature, but I can't see it

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [[/questions/931292]]</blockquote>
    when I open a new tab nothing new happens, I still have the old new tab. How to activate the new tab feature of firefox?? I tried the turorial but nothing

    Did you set the startup page to about:newtab ?
    What is the setting of the browser.newtab.url pref and the browser.newtabpage.enabled pref?
    Do both prefs have the default value?
    *http://kb.mozillazine.org/about:config
    *https://support.mozilla.org/kb/new-tab-page-show-hide-and-customize-top-sites

  • I have changed my Apple ID so that it would reflect my new email address. My Apple devices and icloud info do not display my new ID, even though I use the new one to log into iTunes, etc.  How can I get this problem resolved so that I might feel confident

    After changing my Apple ID I do not seem to be able to recognize it as my proper ID. It does work properly for an iTunes login and password, but, it is not displayed that way on my device when I look at my iCloud settings and other "system level" settings.
    How do I correct this to be confident that I can use a feature, such as "Find My iPhone" and know that the functions and contact info is correct?

    To change the iCloud ID on your device you have to go to Settings>iCloud, tap Delete Account, provide the password to turn off Find My iPhone when prompted, then sign back in with the ID you wish to use.

  • How to reference a class without using the new keyword

    I need to access some information from a class using the getter, but I don't want to use the new keyword because it will erase the information in the class. How can I reference the class without using the new keyword.
    ContactInfo c = new ContactInfo(); // problem is here because it erases the info in the class
    c.getFirstName();

    quedogf94 wrote:
    I need to access some information from a class using the getter, but I don't want to use the new keyword because it will erase the information in the class. How can I reference the class without using the new keyword.
    ContactInfo c = new ContactInfo(); // problem is here because it erases the info in the class
    c.getFirstName();No.
    Using new does not erase anything. There's nothing to erase. It's brand new. It creates a new instance, and whatever that constructor puts in there, is there. If you then change the contents of that instance, and you want to see them, you have to have maintained a reference to it somewhere, and access that instance's state through that reference.
    As already stated, you seem to be confused between class and instance, at the very least.
    Run this. Study the output carefully. Make sure you understand why you see what you do. Then, if you're still confused, try to rephrase your question in a way that makes some sense based on what you've observed.
    (And not that accessing a class (static) member through a reference, like foo1.getNumFoos() is syntactically legal, but is bad form, since it looks like you're accessing an instance (non-static) member. I do it here just for demonstration purposes.)
    public class Foo {
      private static int numFoos; // class variable
      private int x; // instance varaible
      public Foo(int x) {
        this.x = x;
        numFoos++;
      // class method
      public static int getNumFoos() {
        return numFoos;
      // instance method 
      public int getX() {
        return x;
      public static void main (String[] args) {
        System.out.println ("Foo.numFoos is " + Foo.getNumFoos ());
        System.out.println ();
        Foo foo1 = new Foo(42);
        System.out.println ("Foo.numFoos is " + Foo.getNumFoos ());
        System.out.println ("foo1.numFoos is " + foo1.getNumFoos ());
        System.out.println ("foo1.x is " + foo1.getX ());
        System.out.println ();
        Foo foo2 = new Foo(666);
        System.out.println ("Foo.numFoos is " + Foo.getNumFoos ());
        System.out.println ("foo1.numFoos is " + foo1.getNumFoos ());
        System.out.println ("foo1.x is " + foo1.getX ());
        System.out.println ("foo2.numFoos is " + foo2.getNumFoos ());
        System.out.println ("foo2.x is " + foo2.getX ());
        System.out.println ();
    }

  • Can I use the new Firefox Beta for Win 8 on a non-touch screen computer?

    I installed Win 8 on my somewhat old laptop (3 and 1/2 years old). I don't have a touchscreen on it, I don't want to use Internet Explorer, and I badly want to use the new tile Firefox and help it's development. I installed it and tried to enable tile mode but it is not offered in the settings at all. Is it possible to use it without a touchscreen?

    Hi Marko,
    Unfortunately work on the tile interface was discontinued due to low interest. You can find more information here: https://blog.mozilla.org/futurereleases/2014/03/14/metro/
    The code lives on, so the project could well be restarted in the future. But for the time being you can only use Firefox in its traditional "desktop" interface.
    Sorry for the bad news!
    Jayelbe

  • Using the new Call and Chat buttons

    This is really not a Mac issue, even though I use a Mac. It is a general issue regarding the use of the new Call and Chat buttons in web sites and HTML signatures,
    I was using the so called "legacy" buttons, both on my home web site as well as in my HTML signature. Sometime a few days ago they stopped working altogether. I checked the Internet and I saw the post that Skype has discontinued their use and insteasd we would have to use the new Call and Chat buttons that work via a generated script.
    This is fine, but I am having two issues here:
    1) When I include the script on my web site, the Call image always goes on a line by itself. What I want is to have it on the same line with some other social media like images, such as Facebook, LinkedIn, etc. I could do this with the old legacy images but not with this new one.
    2) How can I have now this functionality in an HTML signature? I can't put a script there.
    Thanks for any help!
    George

    As far as I know, you can't change it: first, your photo is probably a .jpg and iMovie will be adapting it to a video file which will result in somewhat of a loss of quality and second, if your original picture is small, it cannot be enlarged without significant loss of quality as it will get blurry while the individual pixels are being made larger - that depends on your camera settings and its photo output size. So it could be either or both of those that is the problem here. Check your camera and see what size you are taking your pictures in.

  • Can I use the new Time Capsule to backup my mid 2010 Macbook Pro? Also can I want to free up my hard disk, can I save my photos and files on the time capsule and later access through wifi?

    Can I use the new Time Capsule to backup my mid 2010 Macbook Pro? Also can I want to free up my hard disk, can I save my photos and files on the time capsule and later access through wifi?

    Can I use the new Time Capsule to backup my mid 2010 Macbook Pro?
    Yes, if you are asking about using Time Machine to backup the Mac.
    Also can I want to free up my hard disk, can I save my photos and files on the time capsule and later access through wifi?
    You are not thinking of deleting the photos and files on your Mac, are you?  If you do this, you will have no backups for those files.
    Another concern is that Time Machine backs up the changes on your Mac. At some point, Time Machine will automatically delete the photos and files from the Time Capsule.....you just don't know when this might occur.
    In other words, only delete files from your Mac that you can afford to lose.

  • I have a new iPod Touch and one apple ID. I want to use My laptop aswell as my desktop computer for the one ipod, using the same apple ID. I have music on both computers and want to merge the two without losing any music or apps. How do I do this?

    I have a new iPod Touch and one apple ID. I want to use My laptop aswell as my desktop computer for the one ipod, using the same apple ID. I have music on both computers and want to merge the two without losing any music or apps. How do I do this?
    My iPod has music and apps from my apple ID that I downloaded to my iPod via iCloud and some apps that I got free from the store, straight onto my iPod, but my laptop has some music on it aswell, separate from my other library. I want to put the music from my laptop into my iTunes library which I want to use on both computers. Is it possible to do this?
    Thanks.

    - You can only sync an iPod to one iTunes library/computer. You can however, manually manage music and videos among different libraries.
    Go to iTunes>Help>iTunes Help>Sync your iPod....>Sync You Device>Set up Syncing>Sync your device manually and follow the instructions.
    - If y wnat to switch syncing libraries/computer see:
    go to iTunes>Help>iTunes Help>Sync your iPod....>Sync You Device>Set up Syncing>Sync your device manually and follow the instructions.
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive: Apple Support Communities
    If all the synced media like music is in the iTunes library of the second computer it is very easy.

  • I share a macbook with my other half and we both use it for our iphones. When syncing using the new software I now have all of her and my contacts on my phone.  I don't want her contacts! How do I get rid?

    I share a macbook with my other half and we both use it for our iphones. When syncing using the new software I now have all of her and my contacts on my phone.  I don't want her contacts! How do I get rid?

    Hi,
    You have 2 solutions:
    1 - You can use 2 differents icloud account
    2 - You use the same account but you don't sync yours contacts.
    You configure that in  Settings > icloud
    You activate or desactivate what you want.
    Have a nice day.

  • I want to transfer my data to new computer and use the new computer for iPhone 5. Have anyone can recommend the best way for me?

    I have some problem to transfer my data via home sharing. (Maybe my internet connection is poor)
    I tried to transfer all the apps and music via home sharing. When it's done, it showed the internet connection is time-out. (So sad )
    So I want some people to help me about the methods to transfer datas from old computer to the new one.
    Then I can use the new one with new iphone 5.
    PS. I use iPhone 3gs with iOS 4.3.5.
    Old computer uses Microsoft WIndows XP.
    New one uses Microsoft Windows 7.
    Thank you

    you can't recover iOS crypted backup password, for security purposes. your backup is useless. sorry.
    if you still have your old iPhone, make a new back-up

  • I created a new ID for my Iphone, because the old ID was an email address I no longer have. Also, the phone wouldn't recognize the password I have always used. Now the problem is when I try to update my apps, it automatically wants to use the old ID.

    I created a new ID for my Iphone, because the old ID was an email address I no longer have. Also, the phone wouldn't recognize the password I have always used. Now the problem is when I try to update my apps, it automatically wants to use the old ID. I've set the new ID for the phone, but it defaults to the old one when asking for a password to update apps.

    That's because all apps are forever tied to the Apple ID used to obtain them, & can only be updated using that ID.
    To use your new ID with these apps, you'll have to delete them, then repurchase. Or, contact iTunes support, explain the situation, & ask that they add these apps to the download queue of your new ID.

Maybe you are looking for