Warning: include() [function.include]: Unable to access /var/www/html/rogue-development/blog2/wp-content/advanced-cache.php in /var/www/html/rogue-development/blog2/wp-settings.php on line 62

Warning: include(/var/www/html/rogue-development/blog2/wp-content/advanced-cache.php) [function.include]: failed to open stream: No such file or directory in /var/www/html/rogue-development/blog2/wp-settings.php on line 62

Warning: include() [function.include]: Failed opening '/var/www/html/rogue-development/blog2/wp-content/advanced-cache.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/rogue-development/blog2/wp-settings.php on line 62

Notice: add_option was called with an argument that is deprecated since version 2.3 with no alternative available. in /var/www/html/rogue-development/blog2/wp-includes/functions.php on line 3468

Notice: register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead. in /var/www/html/rogue-development/blog2/wp-includes/functions.php on line 3382

Notice: register_widget_control is deprecated since version 2.8! Use wp_register_widget_control() instead. in /var/www/html/rogue-development/blog2/wp-includes/functions.php on line 3382
Actionscript « Marc’s Musings

Archive for the 'Actionscript' Category

Page 3 of 3

ObjectHandle updated, and binary now available

I’ve spent a bit more time on my move/resize flex component and there’s now an expanded demo available online.

I’ve also set up a dump of the latest binary .swc that I’ve been working on to the website. With any luck this will be of some use to someone.

http://www.rogue-development.com/objectHandles.xml

New in this version:

- Horizontal & Vertical Anchors
- A selection manager

First look at a Flex Component to resize on screen objects.

I’ve been spending some time working on a flex component to add “handles” to an on screen object to allow an end-user to resize and move it. It’s exactly the same type of functionality when you’re using design mode of Flex Builder.

Below is the first look at the current progress I’ve had.

As you might have noticed it has a few bugs and is far from done feature-wise. It you’d like to keep up on it, take a look at the project page.

If anyone knows of a project doing this same type of functionality, please let me know. I hate to duplicate efforts.

Programatically add constraints through Actionscript

Flex Builder has that great “Constraints” UI that allows you to anchor components to their parent that I’m sure everyone has used.


But what happens if you create an object in actionscript and then you want add constraints to it? There is no “top” property you can set to anchor the component to the top. It turns out the constraint system is entirely based on Flex’s style system and can be used as follows:

var someComponent:SomeComponent = new SomeComponent();
var style:CSSStyleDeclaration = new CSSStyleDeclaration();
style.setStyle(“top”, 0);
style.setStyle(“horizontalCenter”, 0);
someComponent.styleDeclaration = style;

And BAMN, someComponent will be anchored to the top, center of it’s parent (assuming it’s parent is a container that supports anchors.) Available style selectors are:

  1. top
  2. left
  3. right
  4. bottom
  5. horizontalCenter
  6. verticalCenter

You could also specify the styles in a css sheet, or by adding them to an already existing style.

Edit…

As a commenter has posted you can also use the setStyle method in addition to the various other methods I mentioned. So the following would also work:

someComponent.setStyle(“top”,0);