Archive for the ‘XML’ Category

Adobe Evangelist Daniel Dura visits Travelocity

Apr
15

So today Daniel Dura, an Adobe Evangelist, came by Travelocity to talk about Flash, Flex and AIR. It was interesting to here him speak and his hair was redder then pictures led on. But I won’t hold that against him. Read more »

How to create a PureMVC app with Actionscript 3

Feb
13

Update at: How to Add and Remove Mediators in an Actionscript 3 PureMVC App

PureMVC imageSo I have been working alot w/ PureMVC, well everyday for the last month to be exact. I’m going to try to explain PureMVC the best way I know how. It may not be the best, but I hope it can get you started. And when you learn something let me know.

So the example I am doing is a simple one using Lee Brimelow’s code from the ActionScript 3 Advanced XML example. The only difference between his and what I changed is some method name changes and putting it in PureMVC.

So if you don’t know what PureMVC is or you are quite confused on how to use it…well so am I . I’m still learned and hopefully can teach some stuff. I’m not going to go into the specifics of this framework but think of it as a way to introduce a lot separation of code using the Model, View, Controller. I’ll explain what I see as the benefits after I explain the example.

Read more »

Flash CS3 and the TileList

Jul
15

**UPDATE July 19th**
This code uses FlashVars and SWFObject. I ran into a problem, as we continued to build, w/ getting data to show in the swf.
To fix this error switch out[as]
so.addParam(“wmode”, “transparent”);
[/as]with[as]
so.addParam(“wmode”, “opaque”);
[/as]or delete it all together

**UPDATE July 19th**

I’m working on a TileList for work for a peek at our Portfolios. Right now I’m trying to adapt the TileList to my liking with back and forth button instead of the scrollpanel. But I wanted to share the wealth w/ what I’ve dug up on this Flash CS3 component. I find most of what’s online to be really crappy and not too robust.

I’ve provided a zip to my work: titelist.zip

[as]

import fl.controls.ScrollBarDirection;
import fl.events.ListEvent;
import fl.controls.listClasses.*;
import flash.net.*;
import flash.events.*;
import fl.data.*;

var xml:XML;
// this set a var for parameter xmlData that is set in the
// SWFObject
var _xmlData:* = root.loaderInfo.parameters.xmlData;

// if someone for got to set the xmlData parameter
// load default xml
if(_xmlData == undefined)
{
_xmlData = “xml/default.xml”
}

trace(root.loaderInfo.parameters.xmlData);
// request xml file
var requester:URLRequest = new URLRequest(_xmlData as String);
//load xml file
var loader:URLLoader = new URLLoader(requester);

//set dataprovider to the loaded xml
function setItems(evt:Event):void
{
xml = XML(evt.target.data);
trace(xml);
list.dataProvider = new DataProvider(xml);
}

loader.addEventListener(Event.COMPLETE, setItems);

//on click of item go to data/url
function onItemClick(e:ListEvent):void
{
navigateToURL(new URLRequest(e.item.data),”_self”);

}

list.addEventListener(ListEvent.ITEM_CLICK, onItemClick);

// Set scroll bar direction
list.direction = ScrollBarDirection.HORIZONTAL;

// position TileList and set column and row values
list.move(0,0);
list.columnWidth = 122;
list.rowHeight = 112;

list.width = 366;
list.height = 112;
list.columnCount = 3;
list.rowCount = 1;
[/as]

Flash CS3 animator class and loading XML animation at runtime

May
4

So there is a new animator class. It works like FuseXML. The animations are set by nodes and attributes.
To do this:

  1. start a CS3 document
  2. make an mc called ‘abox’
  3. make an animation
  4. select the animation
  5. Commands > Export Motion XML
  6. name xml file “motion.xml”
  7. create an actionscript layer
  8. Then load XML as usual.

add:

import fl.motion.Animator;
import fl.motion.MotionEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.*;
 
var abox_xml:XML;
var requester:URLRequest = new URLRequest("motion.xml");
var loader:URLLoader = new URLLoader(requester);
var abox_animator:Animator;
loader.addEventListener(Event.COMPLETE, startAnimation);
 
function startAnimation(evt:Event):void {
 
abox_xml = XML(evt.target.data);
abox_animator = new Animator(abox_xml, abox);
abox_animator.play();
 
}