Xray update: FLEX CHANGES – please read

Thanks to Andy needing some help on a project, I was able to spend some quality time on Xray to fix a bug and enhance it to work with rawChildren containers in flex.  Above is a picture of the contents of rawChildren object in flex and a Papervision3D BasicView object highlighted.  I’m able to go from that point into the BasicView and see all the Papervision3D goodness ;)

I had to rework a few things to accomodate rawChildren types of objects, but in doing so, I made it more modular so to speak, in terms of the underlying code.  It’s been a struggle to not have to create copies of code that do nearly the same thing with slight tweaks for Flex.  So far so good.

NOTE:  I’ve finally changed the package and name of Flex2Xray.  I’ve basically dropped the “2″ in the folder name and the class.

So now we have:

com.blitzagency.xray.inspector.flex.FlexXray;
var xray:FlexXray = new FlexXray();

again, with the flex version, you don’t have to add it to stage since it has access to the Application object.

Setting focus on TextFields not on stage – Papervision3D

Well, I finally came up with a fix for this issue and thought to archive it.  Basically, the issue is that when you have textfields in a Sprite that you use for a material source for Papervision3D, you want to be able to set focus to those text fields.  Without them being on stage, however, it doesn’t work to say “stage.focus = myTextField”.

So, very simply, all you have to do is add the textfield to the stage, then use stage.focus = myTextField, then re-add back to your Sprite.  Bingo, you have focus in your TextField.  Now, I should say, that i’ve seen it work with just using stage.focus = myTextField, but in this particular situation, adding it to the stage first, then setting focus, then adding it back worked.  So give it a whirl either way.

example:

stage.addChild(myTextField);
stage.focus = myTextField;
this.addChild(myTextField);

Bam! done.  As long as you’re redrawing your material so that you can see what you’re typing ( bitmapMaterial.drawBitmap()), it’ll work just fine.

Tabbing is controlled easily with:


protected function handleKeyUp(e:KeyboardEvent):void
{
if( e.keyCode == 9 ) // tab
{
if( currentField == username )
changeToPassword();
else if( currentField == password )
changeToUsername();
}
}

hope that helps someone!

Online Papervision3D training – Nov 8th. Optimization Techniques

We’re doing one more of these before the year’s end and won’t likely do it again until February 2009.  We weren’t going to do it at all, but we’d had a great response to do one more, so we’re squeezing this one in before the holidays really kick in.

I’m taking a break from traveling for a while, so RMI has set me up with some on-line course time and this weekend (SATURDAY), I’m going to pouring over the Winterwonder Land application and talking about optimization techniques for Papervision and the flash Player in general.

In the course files, I’m including nearly all the demo’s I used for the classes I taught in person as well as the source for Winterwonder Land’s animation engine etc.

If you’re interested, you can sign up over at RMI’s site:

http://www.richmediainstitute.com/node/277

Hope to see you there!