Skip navigation
Help

Papervision3D

warning: Creating default object from empty value in /var/www/vhosts/sayforward.com/subdomains/recorder/httpdocs/modules/taxonomy/taxonomy.pages.inc on line 33.

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!

0
Your rating: None

*UPDATE*
Apparently adobe scheduled maintenance this saturday during the scheduled time for the course (which blows tremendously -they could have asked if anyone was doing something during those hours) I guess it could be argued that no time is a good time, but I'd argue back that midnight would be 90% better option I'm willing to bet... Just sayin'

Anyway, we ARE going to reschedule it asap (like in the next week or 2), and RMI is extending the viewable recording of the session to 2 months for the inconvenience to the students. Sorry for the hassle guys

I'm sorry I'm late on announcing this, I've been super busy with this current client and trying to get everything else done for the course has just consumed all motor skills and brain cells ;(

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/142

Hope to see you there!

0
Your rating: None

What turned out to be just something to finally scratch a strict typing itch i'd had with tweening has no become and full blown side project. Not only did Moses get me started, but Graeme Asher and John Lindquist fueled the fire as well. Graeme's been working on Tween3DCamera and John's been helping me add some other properties like scale/scaleX/scaleY/scaleZ to the property types as well as a small refactor.

If you've tried Go3D lately, you'll notice that I had put static property methods (yeah kinda weird name, but that's what they do ) in Go3D.as, but have now moved them to Value.as in the properties directory. It seemed to make alot more sense with what their function was, and Go3D.as has been deleted for now since it serves no purpose.

check out the project here:
http://code.google.com/p/goplayground/wiki/JohnGrden

svn:
http://goplayground.googlecode.com/svn/trunk/JohnGrden/GO3D

One thing I added just today was the ability to pass a tweenTarget for a 3D object. If you look at the code samples below, you can now just pass a target and it's position and rotation will be used to tween to. You can also use constants to just tween to position or just rotation. You can also pass custom properties for it to use with the target. The swf demo I've posted in the playground basically tells the Cylinder object to use the properties of the orange sphere.

PLAIN TEXT
Actionscript:

  1. protected function tweenAll(e:Event=null):void
  2. {
  3.     resettargetObject();
  4.     tween = new Tween3D(targetObject, [Value.tweenTarget(middleObject)], duration, Easing.easeOutElastic);
  5.     tween.start();
  6. }
  7.  
  8. protected function tweenXYZ(e:Event=null):void
  9. {
  10.     resettargetObject();
  11.     tween = new Tween3D(targetObject, [Value.tweenTarget(middleObject, Value.XYZ)], duration, Easing.easeOutElastic);
  12.     tween.start();
  13. }
  14.        
  15. protected function tweenCustom(e:Event=null):void
  16. {
  17.     resettargetObject();
  18.     tween = new Tween3D(targetObject, [Value.tweenTarget(middleObject, [Value.X, Value.Y])], duration, Easing.easeOutElastic);
  19.     tween.start();
  20. }
  21.  
  22. protected function tweenRandom(e:Event=null):void
  23. {
  24.     tween = new Tween3D(targetObject, [Value.x(getRandom()), Value.y(getRandom()*.5), Value.z(getRandom())], duration, Easing.easeOutElastic);
  25.     tween.start();
  26. }

Value.tweenTarget() returns an array of Go3DProperty objects that Tween3D expects to get to do the tween. It's basically a convenient, yet strictly typed way of doing things. I'd say we're having as much fun as untyped objects at this point - Even more probably ;)

Note:
I'll be teaching on Go3D at the Toronto class in 2 weeks, and if you haven't signed up yet, I seriously suggest getting out there asap - seats are filling up

Now, the reason I say we need base 3D classes for all 3D engines to use is because in a situation where I want to open this up for Sandy3D or Away3D or any other 3D engine that uses x/y/z/rotationX/Y/Z/scaleX/Y/Z, I'd have to write specific classes tailored to their api and object types.

We need to have one set of common 3D classes that define the atom level of a 3D object with the main 10 properties:

x, y, z, rotationX/Y/Z, scale, scaleX/Y/Z

So, I'm going to be starting such an effort and see how that pans out ;) It makes too much sense especially when you consider any project that has to work with a 3D engine, but isn't integrated with the code base. ASCollada being one, and Go3D being another.

I'd love to hear people's thoughts on this matter.

0
Your rating: None