How to add a container to the scene

The code below fails to add Test.mxml to the scene. If I change Test.mxml to be a HBox instead of a UIComponent, it works. What should I do to make the content of the Test appear in the TabNavigator if I keep the Test as a UIComponent?

Thank you!

<? XML version = "1.0" encoding = "utf-8"? >
" < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML " "xmlns:local ="*" layout = "vertical" creationComplete = "init ()" >
< mx:Script >
<! [CDATA]
private function init (): void {}

}
[]] >
< / mx:Script >
< mx:Panel >
< mx:TabNavigator width = "300" height = "225" >
< mx:VBox label = "Login" >
< mx:Text text = 'Instructions go here... '. "/ >
< / mx:VBox >
< mx:VBox label = 'Instructor' >
< local id: Test = "test" / >
< / mx:VBox >
< / mx:TabNavigator >
< / mx:Panel >
< / mx:Application >

Test.MXML

" < = xmlns:mx mx:UIComponent ' http://www.Adobe.com/2006/MXML ">
< mx:HBox id = "dashboard" >
< text mx:Text = "Total correct" / >
< / mx:HBox >
< / mx:UIComponent >

Wrap your Sprites in UIComponent:

var mySprite:Sprite = new Sprite();

... to make the drawing with the Sprite or something else

var uic:UIComponent = new UIComponent();

uic.addChild (mySprite);

myCanvas.addChild (uic);

If this post has answered your question or helped, please mark it as such.

Tags: Flex

Similar Questions

  • How to add a movie to the stage

    The code below is used to create a slide show. It also works a long time that I load my content in container_mc. container_mc is a movieclip that is created on the stage and it contains a simple form for a background.

    Rather than create the movieclip on the stage, I want to generate the movieclip dynamically as follows:

    container_mc1 = new MovieClip;
    container_mc1. Width = 100;
    container_mc1. Height = 100;
    s = new shape;
    container_mc1. AddChild (s);
    this.addChild (container_mc1);

    However, the movieclip is not be added to the stage. It does not work when I Uncomment the line:

    slideView = new SlideshowView (container_mc1);

    How can I connect container_mc1 to the scene? Thank you!

    package {}
    import flash.display. *;
    import flash.events. *;
    import flash.net.URLRequest;
    import the mvc. SlideshowModel;
    import the mvc. SlideshowView;

    SerializableAttribute public class SlideshowDocument extends MovieClip {}
    private var slideModel:SlideshowModel;
    private var slideView:SlideshowView;
    private var req:URLRequest = new URLRequest("data.xml");
    private var container_mc1:MovieClip;
    private var s:Shape;
    public void SlideshowDocument() {}
    container_mc1 = new MovieClip;
    container_mc1. Width = 100;
    container_mc1. Height = 100;
    s = new shape;
    container_mc1. AddChild (s)
    this.addChild (container_mc1)
    slideView = new SlideshowView (container_mc);
    slideView = new SlideshowView (container_mc1);
    slideModel = new SlideshowModel();
    slideView.model = slideModel;
    slideModel.load (req);
    }
    }
    }

    Oops, you need a linestyle or filling.  In addition, you should (not) set a width/height on an object is empty:

    package {}
    import flash.display. *;
    import flash.events. *;
    import flash.net.URLRequest;
    import the mvc. SlideshowModel;
    import the mvc. SlideshowView;
       
    SerializableAttribute public class SlideshowDocument extends MovieClip {}
    private var slideModel:SlideshowModel;
    private var slideView:SlideshowView;
    private var req:URLRequest = new URLRequest("data.xml");
    private var container_mc1:MovieClip;
    private var s:Shape;
    public void SlideshowDocument() {}
    container_mc1 = new MovieClip;
    container_mc1. Width = 100;
    container_mc1. Height = 100;

    container_mc1. Graphics.LineStyle (1);
    container_mc1. Graphics.drawCircle (0,0,200);
    slideView = new SlideshowView (container_mc);
    slideView = new SlideshowView (container_mc1);
    this.addChild (container_mc1)
    slideModel = new SlideshowModel();


    slideView.model = slideModel;
    slideModel.load (req);
    }
    }
    }

  • I use the full version of DASYLab 8.0, how to add PID module in the design of the façade (window layout)? while I can vary the p, i, d values in the window layout

    I use the full version of DASYLab 8.0, how to add PID module in the design of the façade (window layout)? while I can vary the p, i, d values in the window layout

    To do that you will need to change the varibles PID values and then use the sliders to add numbers to a latch for variables that point.

    This is how I think it works in Version 8.

    In all cases, you should move on to 12 more stable summer.

    In addition, unless that is a very slow process, I generally do not like closed loop PID with DASYLab due to the fact that computers is not reliable with timing.

  • How to add more application under the new tab shortcuts when we right click on the desktop.

    How to add more application under the new tab shortcuts when we right click on the desktop.

    Hello

    I suggest you to post your questions in the forums 'Development of the User Interface for Windows Desktop' for better assistance.

    Here is the link: http://social.msdn.microsoft.com/Forums/en-US/windowsuidevelopment/threads

  • How to add a shortcut in the taskbar next to the Start Menu?

    I would like to know how to add a shortcut in the taskbar next to the Start Menu (a place with a small shortcut icon).

    Does anyone have any suggestions?
    Thanks in advance for your suggestions

    Hello

    Have a look here: http://www.sevenforums.com/tutorials/397-taskbar-pin-unpin-program.html

    When you scroll down on this page, you will find a lot more "pin to taskbar" - tutorials.

    Take a look at this little program free of practical assistance, too: http://winaero.com/comment.php?comment.news.108 of the taskbar Pinner

    I hope this helps.

  • How to add multiple lines when the button is clicked

    How to add multiple lines when the click on button now is just add a row .plz give me idea how... waiting for answer

    / public final class screen extends MyScreen
    {
    /**
    * Creates a new object of MyScreen
    */
    ObjectChoiceField obj1 obj2, obj3, obj4.
    Table of String() = {'101 ', ' 102'};
    String of shadow [] = {"Shade1", "Shade2"};
    Rolls of string [] = {'101 ', ' 102'};
    String cutting [] = {"100-150", "150-200"};
    Chain of selectedindex1, selectedindex2, selectedindex3, selectedindex4;
    LabelField lbl1 lbl2, lbl3, lbl4;
        
    GFM LinedGridFieldManager;
    HFM HorizontalFieldManager, hfm1, hfm2 hfm3;
    VerticalFieldManager vfmMain;
        
    public MyScreen()
    {
        
    Set the displayed title of the screen
    hfm1 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    hfm2 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    hfm3 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    HFM = new HorizontalFieldManager (HorizontalFieldManager.FIELD_RIGHT);
    vfmMain = new VerticalFieldManager (Manager.NO_VERTICAL_SCROLL |) Manager.NO_HORIZONTAL_SCROLLBAR);
            
    obj1 = new ObjectChoiceField ("", graph, 0, FIELD_LEFT);
    obj2 = new ObjectChoiceField ("", blind, 0, FIELD_LEFT);
    Obj3 = new ObjectChoiceField ("", rolls, 0, FIELD_LEFT);
    Obj4 = new ObjectChoiceField ("", cuts, 0, FIELD_LEFT);
            
    LBL1 = new LabelField("");
    LBL2 = new LabelField("");
    lbl3 = new LabelField("");
    lbl4 = new LabelField("");
            
    ButtonField btnAdd = new ButtonField ("ADD", FIELD_RIGHT);
            
    GFM = new LinedGridFieldManager (4, LinedGridFieldManager.VERTICAL_SCROLL);
            
    hfm1.setMargin (20, 0, 10, 0);
    hfm1. Add (new LabelField ("Chart"));
    hfm1. Add (obj1);
    hfm1. Add (new LabelField ("Shade"));
    hfm1. Add (obj2);
            
    hfm2. Add (new LabelField ("Rolls"));
    hfm2. Add (Obj3);
    hfm2. Add (new LabelField ("Cuts"));
    hfm2. Add (Obj4);
    HFM. Add (btnAdd);
            
    GFM. Add (new LabelField ("Chart"));
    GFM. Add (new LabelField ("Shade"));
    GFM. Add (new LabelField ("Rolls"));
    GFM. Add (new LabelField ("Cuts"));
            
    vfmMain.add (hfm1);
    vfmMain.add (hfm2);
    vfmMain.add (hfm3);
    vfmMain.add (hfm);
    vfmMain.add (new SeparatorField());
    vfmMain.add (gfm);
    Add (vfmMain);
            
    btnAdd.setChangeListener (new FieldChangeListener()
    {
    ' Public Sub fieldChanged (field field, int context) {}
    TODO self-generating method stub
    selectedindex1 = chart [obj1.getSelectedIndex ()];
    selectedindex2 = shade [obj2.getSelectedIndex ()];
    selectedindex3 = rolls [obj3.getSelectedIndex ()];
    selectedindex4 = cuts [obj4.getSelectedIndex ()];
                    
    While (LBL1. GetText(). Equals("") | LBL2. GetText(). Equals("") | lbl3. GetText(). Equals("") | lbl4. GetText(). Equals(""))
    {
    LBL1. SetText (selectedindex1);
    LBL2. SetText (selectedindex2);
    lbl3. SetText (selectedindex3);
    lbl4. SetText (selectedindex4);
                    
    GFM. Add (LBL1);
    GFM. Add (LBL2);
    GFM. Add (lbl3);
    GFM. Add (lbl4);
                    
    }
    }
    });
    }
    }

    Hi Piya,

    I run your code, and according to your logic that it works correctly.

    It's adding that line only once because according to your logic that one line can be added to MDT, if you do not want to add line on each click on the button, follow these steps:

    selectedindex1 = chart [obj1.getSelectedIndex ()];
    selectedindex2 = shade [obj2.getSelectedIndex ()];
    selectedindex3 = rolls [obj3.getSelectedIndex ()];
    selectedindex4 = cuts [obj4.getSelectedIndex ()];

    Lbl1 LabelField = new LabelField("");
    Lbl2 LabelField = new LabelField("");
    LabelField lbl3 = new LabelField("");
    LabelField lbl4 = new LabelField("");
    If (LBL1. GetText(). Equals("") | LBL2. GetText(). Equals("") | lbl3. GetText(). Equals("") | lbl4. GetText(). Equals(""))
    {
    LBL1. SetText (selectedindex1);
    LBL2. SetText (selectedindex2);
    lbl3. SetText (selectedindex3);
    lbl4. SetText (selectedindex4);
                    
    GFM. Add (LBL1);
    GFM. Add (LBL2);
    GFM. Add (lbl3);
    GFM. Add (lbl4);
                    
    }

  • How to add 2 points on the Noel e? I don't have a 2nd series of digits to the right of the keyboard.

    How to add 2 points on the letter e in the Noel case?  I don't have the 2nd series of digits to the right of the keyboard. Windows 8

    Wednesday, April 23, 2014 23:25:53 + 0000, RobertNortonWZ wrote:

    How to add 2 points on the letter e in the Noel case?  I don't have the 2nd series of digits to the right of the keyboard. Windows 8

    You mean you want the e character? These two points are called a
    umlaut. You do not add points; the e with points is another
    a simple e character. There are several ways to get this
    character, but a simple is to hold the ALT key and type 137.

    As a point of information if you are interested, the subject of a
    umlaut is to indicate that the second of the two successive vowels is
    pronounced separately. So the word 'book' is pronounced buk, but the
    Book name is pronounced BO - ock.

  • How to add two lines when the second row is not visible, but also gets the first data line too?

    Mr President

    Jdev worm is 12.2.1

    How to add two lines when the second row is not visible, but also gets the first data line too?

    I want to add two lines like below picture, but want the second to remain invisible.

    tworows.png

    I asked this question but my way of asking was wrong, that's why for me once again.

    Concerning

    Try to follow these steps:

    1. in the database table to add the new column "JOIN_COLUMN" and add the new sequence "JOIN_SEQ".

    2. Add this new column in the entity object. (You can add this in entity object by right clicking on the entity object and then select "Synchronize with database" then the new column and press on sync)

    3. in your bookmark create button to create only one line NOT 2 rows.

    4 - Open the object entity--> java--> java class--> on the entity object class generate and Tick tick on the accessors and methods of data manipulation

    5 - Open the generated class to EntityImpl and go to the doDML method and write this code

      protected void doDML(int operation, TransactionEvent e)
      {
        if(operation == DML_INSERT)
        {
          SequenceImpl seq = new SequenceImpl("JOIN_SEQ", getDBTransaction());
          oracle.jbo.domain.Number seqValue = seq.getSequenceNumber();
          setJoinColumn(seqValue);
          insertSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
        }
    
        if(operation == DML_UPDATE)
        {
          updateSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
        }
    
        super.doDML(operation, e);
      }
    
      private void insertSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
      {
        PreparedStatement stat = null;
        try
        {
          String sql = "Insert into table_name (COLUMN_1,COLUMN_2,COLUMN_3,JOIN_COLUMN, HIDDEN_COLUMN) values ('" + value1 + "','" + value2 + "','" + value3 + "','" + joinColumn + "', 1)";
          stat = getDBTransaction().createPreparedStatement(sql, 1);
          stat.executeUpdate();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
        finally
        {
          try
          {
            stat.close();
          }
          catch (Exception e)
          {
            e.printStackTrace();
          }
        }
      }
    
      private void updateSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
      {
        PreparedStatement stat = null;
        try
        {
          String sql = "update table_name set column_1='" + value1 + "', column_2='" + value2 + "', column_3='" + value3 + "' where JOIN_COLUMN='" + joinColumn + "'";
          stat = getDBTransaction().createPreparedStatement(sql, 1);
          stat.executeUpdate();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
        finally
        {
          try
          {
            stat.close();
          }
          catch (Exception e)
          {
            e.printStackTrace();
          }
        }
      }
    
  • How to add a tail to the end of a text in photoshop?

    How to add a tail to the end of a text in photoshop?

    I tested the police (from dafont.com) in the real Photoshop on a Windows 7/32 bit computer.

    It is all ok.

    Fenja

  • How to add an outline to the text?

    How to add an outline to the text?

    Add a line in the character of the text layer settings.

  • How to make a link in the scene as an anchor?

    How to make a link in the scene as an anchor?

    I mean, for example, create a button with a link to go to the top or the bottom or other parts of the page. Thank you

    In the same example I have on this page illustrates this functionaility

    http://forums.Adobe.com/thread/1084037

    Darrell

  • How to add a space between the currency symbol and price?

    Hello

    Can you please guide me how to add a space between the currency symbol and price?

    Support told me this question in the forums because it is done with JavaScript and it is not covered in the official documentation.

    Any who have done this? I would like to turn 20 at 13.20 RON RON13 or 32, 90 to 32,90 USD.

    Thank you!

    Hello.

    I test and it works.

    If any who need it, this is how I did it.

    I changed the models of Modules-> page layouts of the shop online-> overall layout.

    I added at the end of the HTML code, the code following JS:

    The result can be seen here: http://magazindepiese.worldsecuresystems.com/accesorii/chimice?Page=1&Items=12

    Instead of PRICE: RON22, 62, now it's READY: 22,62 RON that is correct for the Romania.

    Thank you Mario!

  • How to add specific assistance to the vi's house or application independent labview?

    Hi, I want to add Help for my application, build using labview. so that the application has become easy to use.

    in my application, there is one main VI and other 8-10 sup/sub-sub sub-sub VI. I want to place of the handling instructions and other help in the main menu of help of the VI.

    Can someone help me with this problem? How to add this help. Currently, this option 'Search the help of this vi' was disabled in the application.

    In addition to adding description and point to each control and indicator, the description in the properties of the VI > Documentation, the help of LabVIEW (of all places) contains information on the use of Microsoft tools to compile a help file. Just look for the help"" section. As we have just seen, the hardest part is to get the user to use the help.

  • How to add new increase in the pool instead of trowing a mistake.

    Im trying to build a game, and after many attempts and hours of reflection, that I managed to create something that looks like a game. Now, the problem is that there are so many objects that are constantly creation and deletion of the scene. the game starts to slow down (it is laggy.). So I searched the net and realized that I have to use a 'method of object pool' instead of creating and deleting of objects after that I no longer, any use of them if I want to make the game more memory.

    At first, I didn't use this method (object pool), but after a while, I realized that I don't have a lot of options. So I started looking for how and why and how.

    Yet, in this example im just try this for the cause of balls (for now) if I can do it for them, I can manage to do it for other objects and projects (it will be easy for me to understand what is past., what am I, when can I add an existing object from the pool and when im creating a (when there are no things like this))

    I copy part of this code go to a tutorial that I found on the net but, since then, so I don't know how to increase the pool rather than raise this error. I tried to create a new object or to increase the length of the pool, but... it doesn't work, so I'm sure that I'm not doing something the way it should be done.

    So I have this so far:
    There is a 'simple' pool who calls a simple form (point circle) class and giving the main stage when you press the button 'SPACE'

    package
    {
              import flash.display.Sprite;
              import flash.events.Event;
              import flash.display.Bitmap;
              import flash.display.BitmapData;
              import flash.display.Shape;
      
              public class Bullet extends Sprite{ 
      
                        public var  rectangle:Shape = new Shape();
      
                        public function Bullet(){
                                  super();
                                  addEventListener(Event.ADDED_TO_STAGE, init);
      
                                  graphics.beginFill(0xFF0000);
                                  graphics.drawRect(-5, -5, 10,10);
                                  graphics.endFill();
                        }
      
                        private function init(event:Event):void{
      
                        }
              }
    }
    
    

    the SpritePool where I can't understand how to replace error new throw with a new code which increases the pool

    package {
              import flash.display.DisplayObject;
    
    
              public class SpritePool {
                        private var pool:Array;
                        private var counter:int;
    
    
                        public function SpritePool(type:Class, len:int) {
                                  pool = new Array();
                                  counter = len;
    
    
                                  var i:int = len;
                                  while (--i > -1) {
                                            pool[i] = new type();
                                  }
                        }
    
    
                        public function getSprite():DisplayObject {
                                  if (counter > 0) {
                                            return pool[--counter];
                                  } else {
                                            throw new Error("You exhausted the pool!");
                                  }
                        }
    
    
                        public function returnSprite(s:DisplayObject):void {
                                  pool[counter++] = s;
                        }
              }
    }
    
    

    and the play class (the class of documents)

    package {
              import flash.ui.Keyboard;
              import flash.display.Sprite;
              import flash.events.Event;
              import flash.events.KeyboardEvent;
              import flash.display.Bitmap;
              import flash.display.BitmapData;
              import flash.display.Shape;
    
    
              public class Game extends Sprite {
    
    
                        private var ship:Shape;
                        private var bullets:Array;
                        private var pool:SpritePool;
    
    
                        public function Game() {
                                  Assets.init();
                                  addEventListener(Event.ADDED_TO_STAGE, init);
                        }
    
    
                        private function init(event:Event):void {
                                  pool = new SpritePool(Bullet,10);
                                  bullets = new Array();
                                  ship = new Shape();
      
                                  ship.graphics.beginFill(0xFF00FF);
                                  ship.graphics.drawRect(0,0, 60, 60);
                                  ship.graphics.endFill();
      
                                  ship.x = stage.stageWidth / 2 - ship.width / 2;
                                  ship.y = stage.stageHeight - ship.height;
                                  addChild(ship);
    
    
                                  stage.addEventListener(KeyboardEvent.KEY_DOWN, onDown);
                                  addEventListener(Event.ENTER_FRAME, loop);
                        }
    
    
                        private function onDown(event:KeyboardEvent):void {
                                  if (event.keyCode == Keyboard.SPACE) {
                                            var b:Bullet = pool.getSprite() as Bullet;
                                            b.x = ship.x + ship.width / 2;
                                            b.y = ship.y;
                                            addChild(b);
                                            bullets.push(b);
                                            trace("Bullet fired");
                                  }
                        }
    
    
                        private function loop(event:Event):void {
                                  for (var i:int=bullets.length-1; i>=0; i--) {
                                            var b:Bullet = bullets[i];
                                            b.y -=  10;
                                            if (b.y < 0) {
                                                      bullets.splice(i, 1);
                                                      removeChild(b);
                                                      pool.returnSprite(b);
                                                      trace("Bullet disposed");
                                            }
                                  }
                        }
              }
    }
    
    any suggestions/help how to do it 
    

    To put you on the track (the formalization of requirements errors and events), here, would be a small example. Your pool class:

    package

    {

    import flash.display.DisplayObject;

    public class SpritePool

    {

    private var pool: Array;

    private var count: int;

    private var classRef: Class;

    public get acquainted with what remains in the pool

    public function get availableObjects (): int

    {

    return the meter;

    }

    public void SpritePool (type: Class, len:int)

    {

    classRef = type;

    pool = new Array();

    counter = len;

    var i: int = len;

    While (-I > - 1).

    swimming pool [i] = new classRef();

    }

    public function getSprite (): DisplayObject

    {

    If (counter > 0)

    back pool [-counter];

    on the other

    throw new Error ("PoolExhausted");

    }

    public void returnSprite(s:DisplayObject):void

    {

    pool [counter ++] = s;

    }

    public void increasePool(amount:int):void

    {

    amount of Counter +=;

    While (-amount > - 1).

    pool.push (new classRef());

    }

    public void decreasePool(amount:int):void

    {

    If (counter > = amount)

    {

    counter = amount;

    pool.splice (counter - amount, amount);

    }

    on the other

    {

    throw new Error ("PoolDecreaseFail");

    }

    }

    }

    }

    Now you're catching these errors. Again, the errors should be formalized or you can use the events by extending IEventDispatcher. I kept it simple.

    Here would be the simple ball class that I use:

    package

    {

    import flash.display.Sprite;

    SerializableAttribute public class point extends Sprite

    {

    private var ball: Sprite;

    public void Bullet (): void

    {

    var ball: Sprite = new Sprite();

    bullet.graphics.beginFill(0xFF0000,1);

    bullet.graphics.drawCircle (-5, -5, 10);

    bullet.graphics.endFill ();

    addChild (bullet);

    }

    }

    }

    Draws just a red circle just to see...

    Here is a complete example of its use. It will be important both of these classes (recorded as SpritePool.as and Bullet.as in the same folder). Paste in the Panel actions on frame 1:

    Import SpritePool;

    import the ball; a circle simple red 10px

    import flash.display.Sprite;

    import flash.utils.setTimeout;

    fill the pool, Swimsuits optional

    var pool: SpritePool = new SpritePool (ball, 10);

    Enter a few items from the pool

    Array of objects currently held

    var myBullets:Array = new Array();

    While (pool.availableObjects > 0)

    myBullets.push (pool.getSprite ());

    display in random positions

    for (var i: int = 0; i< mybullets.length;="">

    {

    addChild (myBullets [i]);

    position

    myBullets [i] .x = int (Math.random () * stage.stageWidth);

    myBullets [i] there = int (Math.random () * stage.stageHeight);

    }

    trace ("myBullets was" + myBullets.length + "of the bullets!) pool has"+ pool.availableObjects +"left");

    now, I want more, but I need to check for errors

    VR;

    {

    If that fails, no party!

    myBullets.push (pool.getSprite ());

    }

    catch (e: *)

    {

    This should be something personal, but for speed, fast and dirty

    If (e == ' error: PoolExhausted "")

    {

    trace ("from oh no more balls!") I need more! ») ;

    pool.increasePool (10);

    trace ("added 10 more, now available in the pool" + pool.availableObjects);

    }

    }

    try to reduce the pool of 15, what should the error

    VR;

    {

    pool.decreasePool (15);

    }

    catch (e: *)

    {

    again, should be a formal error

    If (e == ' error: PoolDecreaseFail "")

    {

    trace ("Oops, can't reduce the pool of 15! We will adjust all the extras, available is "+ pool.availableObjects);

    We know that this will work, no error checking

    pool.decreasePool (pool.availableObjects);

    trace ("left in the pool:" + pool.availableObjects);

    }

    }

    Now let's wait for 5 seconds and remove any return to the pool

    setTimeout (ReturnToPool, 5000);

    function ReturnToPool (): void

    {

    Now we will return all objects at the pool

    While (myBullets.length > 0)

    {

    removeChild (myBullets [myBullets.length - 1]);

    pool.returnSprite (myBullets.pop ());

    }

    Now check the pool, should have 10

    trace ("Amount of current bullets to use" + myBullets.length + ", in the pool" + pool.availableObjects);

    }

    For ease, you can simply download my example source (registered until CS5).

    Anything here is just semantics. For example instead of raise an error because the pool is too small, you could simply increase the pool of a fixed amount of yourself and return the requested objects.

    To keep as low as possible objects, you can use a timer to measure the amount of objects in use on a duration and reduce the pool properly, knowing that the pool will grow as it should.

    All this is just to avoid the creation of unnecessary objects.

    BTW, here's my trace which must match your:

    myBullets has 10 balls! pool has 0 left.

    Oh not more balls! I need more!

    Added 10 more, now available in the pool 10

    Oops, can't reduce the pool by 15! We will cut all the extras, available is 10

    Left in the pool: 0

    (after 5 seconds)

    Amount of used balls 0 in the pool 10

  • Anyone know how to enter values containing / by the numbers?

    Anyone know how to enter values containing / numbers?  I am trying to enter values of blood pressure requiring this symbol.  Thank you

    You can force numbers does not interpret the value as a number by typing the single quote... like this:

    120/72

    the column text format or

    or enter systolic diastolic and columns in then next:

    Systolic

    Diastolic

    120

    72

    124

    80

Maybe you are looking for

  • Why using Mailchimp newsletter is marked as scam

    Mailchimp newsletter contains links, but it seems to me that they are routed through MC Server because they all got the list - manage .com as a domain name in the bulletin. I guess that Mailchimp using this transfer to avoid being marked as scam/spam

  • Update iOS affects storage?

    I thought about it for a long time now. Ios updates use memory? I mean, when I look at the use of the storage list, in case theres a new update, new update ios x.x.x says ~ 400 MB. So, if I deciede to update, I never will have 400 MB less storage to

  • Satellite X 200: Cannot write to the memory card error message

    Hello Can help you, I have a X 200 with XP Professional installed I continue to receive errors saying "the memory could not be wrtitten" I returned the machine to your service center, but they said that they could not work on the machine, unless Vist

  • AutoComplete does not work when you enter a URL

    Firefox on Fedora Linux x86_64 fc13 3.10.6. View all history shows the history of visited web sites. "Remember history", it is on. AutoComplete worked. I tried to uncheck display the bookmarks bar, but do not know if this has caused the loss of AutoC

  • I want to know how to use the fingerprint, that I had to my notes

    I want to know how I put the finger impression that I would be in settings on my notes please