Archive for July, 2008

Hi Everyone,

I haven’t been posting for a while, it is not that I’m lazy ;) We’ve been working on something exiting that will be release in a while, be patient.

I’ve solved some bugs in BaseUI, one about the width of a DisplayObject which wasn’t updated well when the content changed.

I’ve also added a keepOnScreen property set by default to true in BaseUI and ElementUI. It won’t be a final solution as I’m going to build layouts when I’ll have time, they will handle this behavior in a better way. At the moment, with this property set to true, the top-left corner of a DisplayObject won’t go off screen.

BaseUI page updated, see the demo.

Comments No Comments »

Hi everyone,

I've added global references and a property "reference" in BaseUI (and ElementUI).

As I'm explaining in the tutorial, an ElementUI need a reference to set the position and the size of a DisplayObject. By default, the stage is the reference, set with the property of the ElementUI class "onStage". If the property onStage is set to false, the reference is the parent of the DisplayObject.

This is the basic behavior of BaseUI.

You can now specify any reference in the ElementUI class. The property "reference" can be set with a DisplayObjectContainer (Stage, Sprite, MovieClip, etc) and has priority on the onStage property:

Actionscript:
  1. var element:ElementUI = baseUI.add(mySprite);
  2. element.reference = mySpriteContainer;

I've also added the same properties to the BaseUI class, they are what we can call a "global default reference". If you set the onStage property or the reference property of the BaseUI class (not the ElementUI class), when you add a new element in the BaseUI class, those properties will assign the same values to the ElementUI instance created. It just mean if you have 50 ElementUI instances and you want to set the reference property or the onStage property on all those instances, just use the BaseUI ones before adding the DisplayObject:

Actionscript:
  1. var baseUI:BaseUI = new BaseUI(this);
  2. baseUI.reference = mySpriteContainer; // or baseUI.onStage = false;
  3. var element1:ElementUI = baseUI.add(mySprite); // the reference is mySpriteContainer
  4. var element2:ElementUI = baseUI.add(mySprite); // the reference is mySpriteContainer
  5. var element3:ElementUI = baseUI.add(mySprite); // the reference is mySpriteContainer

If you need to reset the reference:

Actionscript:
  1. element.reference = null;

As usual, I've updated the BaseUI main page.

Comments 1 Comment »