flex
Flex 4 States
I’m going on a bit of a Flex 4 kick this week so I decided to put out a few video tutorials on the new features of Flex 4 and FlashBuilder. Tonight’s video covers the changes to Flex 4 states.
Click to view the video in a pop-up. Right-click and “save as” to download the video to your hard drive.
Watch Flex 4 States Video Tutorial
After watching the video, try out the new states markup on the Application backgroundColor style
There’s more than one way to skin a ScrollBar
This is a little off-topic from my usual Papervision3D posts, but it’s my blog and I’ll post what I want to
If you’ve ever tried skinning a scrollbar in Flex, you’ve probably learned it can be quite the pain in the rear. Using Degrafa (probably my favorite open-source Flex project), I put together a little package to help make the process a little easier. This example is still pretty advanced if you’re new to skinning (especially if you’re new to Degrafa), but don’t be afraid to start playing with the code to see what happens when you make your own changes.
Papervision3D in MXML
This falls under the “just because I can” category
Just copy and paste this code into any Flex project with the Papervision3D.swc in the libs and you’re good to go!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | <?xml version="1.0" encoding="utf-8"?> <view:BasicView xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:view="org.papervision3d.view.*" xmlns:scenes="org.papervision3d.scenes.*" xmlns:primitives="org.papervision3d.objects.primitives.*" xmlns:materials="org.papervision3d.materials.*" opaqueBackground="#ffffff" added="startRendering();" > <view:scene> <scenes:Scene3D> <scenes:objects> <primitives:Sphere x="300"> <primitives:material> <materials:ColorMaterial fillColor="0xcc0000"/> </primitives:material> </primitives:Sphere> </scenes:objects> </scenes:Scene3D> </view:scene> </view:BasicView> |
MXML without the Flex framework
This post might be a bit on the advanced side…
I was talking with Tyler earlier today and he brought up a neat little trick I hadn’t really thought of before: You can write MXML without the Flex framework. Of course you won’t get all the benefits of the Flex framework, but you’ll still be able to build out neat little MXML components with a little bit of work and, more importantly, you won’t have the ~130K of the Flex framework weighing down your app.
You’ll notice the size of the swf below is around 1K.
Maybe if I get bored later this week I’ll write a demo Papervision3D app solely in MXML.
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 | <?xml version="1.0" encoding="utf-8"?> <root:ThisIsNotAUIComponent xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:root="*"> <mx:Metadata> [SWF(width="900", height="480", backgroundColor="#ffffff")] </mx:Metadata> <!-- you won't have to do this children node garbage in Flex 4 --> <root:children> <root:RandomShape/> <root:RandomShape> <root:RandomShape/> <root:RandomShape> <root:RandomShape/> <root:RandomShape/> <root:RandomShape/> </root:RandomShape> </root:RandomShape> <root:RandomShape/> <root:RandomShape/> <root:RandomShape/> <root:RandomShape/> <root:RandomShape/> <root:RandomShape/> <root:RandomShape/> <root:RandomShape/> <root:RandomShape/> <root:RandomShape/> <root:RandomShape/> <root:RandomShape/> <root:RandomShape/> <root:RandomShape/> </root:children> </root:ThisIsNotAUIComponent> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | package { import flash.display.DisplayObject; import flash.display.Sprite; [DefaultProperty("children")] public class ThisIsNotAUIComponent extends Sprite { [ArrayElementType("ThisIsNotAUIComponent")] public function get children():Array { return null; } public function set children(value:Array):void { for each(var child:ThisIsNotAUIComponent in value) { addChild(child); } } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | package { import flash.filters.DropShadowFilter; public class RandomShape extends ThisIsNotAUIComponent { public function RandomShape() { var randomColor:Number = Math.random() * 0xffffff; var randomX:Number = Math.random() * 900; var randomY:Number = Math.random() * 480; graphics.beginFill(randomColor); graphics.drawRect(randomX - 150, randomY - 150, 150, 150); graphics.endFill(); filters = [new DropShadowFilter()]; } } } |
Search
Recommended Books
Speaking at FITC Toronto
Recent Posts
- FDT Theme Designer
- 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
- End dump
- Test if a plane is within the view of the camera (aka testing if culled)
- Materials Reference
Recent Comments
- BAM5 on haXe Tutorial
- AlexG on Finding 2D Coordinates of a DisplayObject3D
- Josh on ActionScript 3 – Model View Controller (MVC)
- martin everett on requests
- martin everett on requests
- lillacska on Dragging Spheres
- Guy Ritchie on MXML without the Flex framework
- Pedro on ActionScript 3 – Namespaces
- daveevolve on AS3DMod Perlin Noise
- sebomoto on haXe Tutorial
Categories
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Jan | ||||||
| 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 | ||||
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

