Adobe Flex Class Slides Oct 10
Adobe Flex Class Slides Oct 10
CONTACT INFO
email: walt.schlender@gmail.com web: http://www.waltschlender.com
DAY 1
USE HTML
#2 USE FLASH
STEP 1
Open the Flash IDE (700$) where you will draw + position a button and some text. Youll want to set the text color on your text to purple.
STEP 2
Convert the text and button image into movie clips
STEP 3
Select the link and the button and give them names
STEP 4
Open the code editor and add the following code to the rst frame of the timeline?
RUN IT
The result:
#3 USE FLEX
Open Flex Builder, create a new project, enter the following code:
THE RESULTS
WHAT IS FLEX?
Lets move out to a 100000ft view so we can understand better...
2 QUESTIONS:
1. Where does Flex t into a companys technology stack when the company decides to build an application?
Your Personal Computer View - Cocoa (Mac), .Net Framework (win) Controller - C++, Ruby, Java, C# Model - Database, File, Object Map
LOCAL APPLICATION
Monday, June 27, 2011
ACTIONSCRIPT
What
HTML text is sent across the web Web Server Controller - PHP, Java, Ruby, ASP Model - Database, File, Object Map
Your Web Browser View - HTML & JavaScript or Flash/Flex Controller - (ActionScript3, AJAX) Model - Object Map (ActionScript3, AJAX)
XML/JSON/AMF is sent across the web Web Server Controller - PHP, Java, Ruby, ASP Model - Database, File, Object Map
A WEB APPLICATION
Monday, June 27, 2011
http://www.google.com/#hl=en&q=walt+schlender&btnG=Google+Search&aq=f&oq=walt+schlender&fp=NCbywrawV3w
http://www.google.com/#hl=en&q=walt+schlender&btnG=Google+Search&aq=f&oq=walt+schlender&fp=NCbywrawV3w
WEB APPLICATIONS
MORE COMPLICATED... FLOW IS MOSTLY THE SAME BUT...
SERVER
USERS BROWSER
Server
50000FT
How do you construct these building blocks?
Model Languages
JavaScript
Java
Flex
HTML
Flash
Ruby
Template Languages
PHP JSP
View Languages
VIEW LANGUAGES
HTML, AJAX, FLASH(ActionScript)/FLEX
FLASH? AJAX?
FLASH? AJAX?
FLASH? AJAX?
Not the video player
http://www.youtube.com/experiencewii
FLASH? AJAX?
FLASH? AJAX?
FLASH? AJAX?
http://www.justin.tv
HTML FIRST
Small HTML page demo
<body>
<div id=block>
<div id=block>
Move this div around the screen when the user clicks
Monday, June 27, 2011
CLASSES (OBJECTS)
public class BatMobile{ }
VARIABLES (INSTANCES)
var mobile1:BatMobile = new BatMobile();
VARIABLE TYPES
var x:TYPE = new TYPE();
int
Object
Number
object
- everything is an
decimal)
Your
Boolean Array
Pre-dened
Sprite
String
- Letters
FUNCTIONS
public function startBatMobile():void{ }
EVENT DISPATCHING
public class BatMobile extends EventDispatcher{ public function handleBatSummons():void{ this.dispatchEvent(new Event(bat-alert)); } }
CONDITIONALS
A function we dened elsewhere
INHERITANCE - IS A...
public class BatMobile extends Sprite{ }
Pre-built ash object which has visual appearance + x and y position info
CLASS LAYOUT
package{ public class Batman extends Warrior{ public static const UNKNOWN:int = -1; //These are secret -- because nobody knows Batman private var _height:int; private var _weight:int; private var _utilityBelt:Array = new Array; public var color:String = black; public function Batman():void{ } public function get weight(name:String):int{ if(name == Alfred){ return _weight; }else{ return UNKNOWN; } } } }
Monday, June 27, 2011
LOOPS
for(var i:int=0; i < 12; i++){ trace(The + i + day of christmas); }
Child 1
Child 2
Child 1
The Stage
Monday, June 27, 2011
:(
Monday, June 27, 2011
DASHBOARDS
DESKTOP APPS
- Tweetdeck
Monday, June 27, 2011
WIDGETS/COMPONENT KITS
MODELS
The Simplest of Models
XML
Make these up... just be consistent
http://www.example.com?username=something&password=something
Java Ruby
RUBY PROS/CONS
Pros
Clean
Cons
Slower Hasnt
than Java
Strong Cross
Simple
Relatively
less
Fast
to develop in ruby
JAVA PROS/CONS
Pros
Scales Cross
Cons
More
complex to develop using Java than alternatives - so you have to write more to do less community documentation isnt easy to get at
Libraries
for just about anything you can imagine have been built of programmers
VERBOSE
Fragmented
Lots
Excerpt
PHP PROS/CONS
Pros
Focused Well Has
Cons
Missing
purpose
documented
well
Installed
ACTIONSCRIPT PROS/CONS
Pros
Rich Can
Cons
Harder
experience
do anything you want visually (video/audio) do things which cant be done with AJAX Java and C# so easy to learn
to maintain an ActionScript application than HTML application tend to require more skilled & expensive coders to build artistic talent TOO
Can
Applications
Like
Requires
AJAX PROS/CONS
Pros
Open-Source Ubiquitous Quickest Limit
Cons
to what you can accomplish with AJAX to maintain issues
get into
experience to just
Hard
Cross-browser
Large
XML Parser
View - NONE Controller - MainApp Sprite Model - XML le parser & Audio Object
DAY 2
FLEX
An extension to ActionScript which makes writing views easier - similar in difculty to writing HTML views
Includes:
Component Framework Tag Version of ActionScript (MXML) Layout Engine
Data Binding
COMPONENT FRAMEWORK
Collection of buttons, labels, textelds and other tools to help speed development along for developers
NOW
Button = <mx:Button /> Label = <mx:Label />
Output
LAYOUT ENGINE
HBox, VBox, Canvas... - well cover more of these later
CLASSES
INHERITANCE HIERARCHY
SYNTAX DETAILS
METHODS
EVENTS
EVENT DETAILS
HOW TO USE
EXAMPLE
Server
Monday, June 27, 2011
<mx:Application></mx:Application>
DATA PROVIDERS
Set the views dataProvider property to the model...
Model View
ITEM RENDERER
Children
TileList . . .
XML
Monday, June 27, 2011
Model
XML
XML
XML
XML
XML
XML
VBox
CANVAS CONTAINER
(0,0)
CONTROLS
<mx:Button /><mx:Label /><mx:TextInput />
Some common properties - label, text - which one goes with which tag (above)
BUTTONS
<mx:Button /> <mx:LinkButton /> Properties: label, id Events: click
LABELS
Properties: text
TEXT INPUT
Events: change Properties: text, editable Exercise: trace(hi) - whenever the text changes
CHECKBOX
Properties: selected
IF YOU HAVE A HSLIDER WHAT PROPERTY COULD YOU SET TO MAKE IT 50% TRANSPARENT
HINT: Look it up in the API reference
DATA GRIDS
LISTS
MENU BARS
SOURCE CODE
CSS
Does this:
OTHER NAMESPACES
Includes other les in my project Composites my custom view into this view
SKINNING - SCALE9
DEBUGGING
BREAKPOINTS
VARIABLE INSPECTION
Demo Application
APPLICATION STRUCTURE
FLASH + FLEX
DEMO APP
http://www.free-online-dice.com