Using a Flex Component as a Material
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | <?xml version="1.0" encoding="utf-8"?> <mx:Application layout="absolute" minWidth="640" minHeight="480" xmlns:mx="http://www.adobe.com/2006/mxml" applicationComplete="applicationCompleteHandler(event)" > <mx:Script> <![CDATA[ import org.papervision3d.objects.primitives.Plane; import org.papervision3d.materials.MovieMaterial; import org.papervision3d.view.BasicView; import mx.events.FlexEvent; private var plane:Plane; private var basicView:BasicView; protected function applicationCompleteHandler(event:FlexEvent):void { basicView = new BasicView(width, height); rawChildren.addChild(basicView); basicView.camera.focus = 10; basicView.camera.zoom = 100; basicView.viewport.interactive = true; var material:MovieMaterial = new MovieMaterial(myAwesomePanel, true, true, true); material.interactive = true; material.smooth = true; material.doubleSided = true; plane = new Plane(material, myAwesomePanel.width, myAwesomePanel.height, 10, 10); basicView.scene.addChild(plane); addEventListener(Event.ENTER_FRAME, enterFrameHandler); } private function enterFrameHandler(event:Event):void { plane.rotationY++; basicView.singleRender(); } protected function button_clickHandler(event:MouseEvent):void { textArea.text = ""; } ]]> </mx:Script> <mx:Panel id="myAwesomePanel" width="204" height="160" verticalAlign="middle" layout="vertical" horizontalAlign="center" includeInLayout="false" blendMode="{BlendMode.ERASE}" x="-1000" y="-1000" > <mx:TextArea id="textArea" text="Blah blah blah"/> <mx:Button label="Click to clear text" click="button_clickHandler(event)"/> </mx:Panel> </mx:Application> |
-
Dan Lines
-
mores
-
Aleks
-
Aleks
-
xero / the.fontvir.us
-
michael keating
-
Nawara
-
flamander
-
Ken Gareee
-
Ken Gareee
-
michael keating
-
Gabriel.Wang(From China)
-
John Lindquist
-
keyriest
-
Peter Velichkov
Search
Recommended Books
Speaking at FITC Toronto
Recent Posts
- Moving to johnlindquist.com
- AsyncCommand with Robotlegs, Signals, Flight, MinimalComps
- Search Widget – Robotlegs, Signals, Flight, Minimal Comps, Yahoo Astra
- FDT Super Awesome March Deal
- haXe Tutorial
- AS3 Signals Tutorial
- Preferred Video Tutorial Resolution?
- TweenMax – Tweening a timeline (Advanced Tweening)
- Robotlegs + Flight + Union Platform
- Back in the saddle
- Eclipse Theme Designer Preview
- RobotLegs Hello World Video Tutorial
- 10 Things Every Senior Flash Developer Should Know
- Efflex – 3D Effects for Flex
- MorphController – Mighty Morphing Papervision3D
Recent Comments
- reverse cell phone lookup on Augmented Reality – Recursive Webcam
- Register Domain Name on Augmented Reality – Recursive Webcam
- Katie on Augmented Reality – Recursive Webcam
- software akuntansi terbaik on Back in the saddle
- loan rates on Augmented Reality – Recursive Webcam
- loan rates on Looking around the inside of a Sphere
- reverse phone lookup on Looking around the inside of a Sphere
- Oidhreachta on The Spotlight Effect (Dimming the unselected)
- Hosting company on archive
- aanbae on Back in the saddle
Categories
Archives
Preferred Video Tutorial Resolution
- 1024x768 (53%, 85 Votes)
- 1280x1024 (15%, 24 Votes)
- 1920x1080 (15%, 24 Votes)
- 800x600 (13%, 20 Votes)
- 480x320 (4%, 6 Votes)
- 640x480 (0%, 2 Votes)
Total Voters: 160


