Re: [Flashcoders] OOP Books (OT)

2010-03-08 Thread Geografiek

Hi Susan,
I liked 'The Object-Oriented Thought Process' by Matt Weisfeld (not  
Actionscript)

and of course Colin Moock's 'Essential Actionscript 3.0'
HTH
Willem van den Goorbergh

On 5-mrt-2010, at 18:55, Susan Day wrote:

I'm going to start another thread on this, a bit OT. What are the  
best books

for learning OOP?
TIA,
Susan
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
Geografiek is a Dutch, Utrecht-based map and chart design company.
Willem van den Goorbergh can be contacted by telephone: (+31) 
30-2719512 or cell phone: (+31)6-26372378

or by fax: (+31)302719687
snail mail: Hooghiemstraplein 89 3514 AX UTRECHT
Visit our website at: http://www.geografiek.nl
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] OOP Books (OT)

2010-03-08 Thread Mark Burvill
Advanced Actionscript 3 with Design Patterns by Joey Lott and Danny Patterson 
is excellent for good solid AS3 applications of standard patterns
http://www.amazon.co.uk/gp/product/0321426568/ref=oss_product

--
Mark Burvill

Antifuzz
www.antifuzz.com
twitter.com/antifuzz
Tel: 0117 954 4036
Mob: 07780 608 498



On 5 Mar 2010, at 17:55, Susan Day wrote:

 I'm going to start another thread on this, a bit OT. What are the best books
 for learning OOP?
 TIA,
 Susan
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] swf doesn't work the same online

2010-03-08 Thread John Singleton
Hi;
I built a swf that works the way I want it in Flash, but when I upload it, it 
acts differently! I built buttons in as3 like this:

function nav(nname:String, nurl:String, myX:int, bgcolor:uint):void
{
myfont2 = 'Arial';
mydize = 15;
mytxtcolor = 0x00;
myborder = true;
mybordercolor = 0xFF;
myY = 170;
myfill = 0x97f9ec;
mynav = new TextField();
var format:TextFormat = new TextFormat();
format.font = myfont2;
format.size = mysize;
mynav.htmlText = 'a href=' + nurl + '.html' + nname + '/a';
mynav.textColor = myTextColor;
mynav.border = myborder;
mynav.borderColor = mybordercolor;
mynav.background=true;
mynav.backgroundColor = bgcolor;
mynav.autoSize = TextFieldAutoSize.LEFT;
mynav.x = myX;
mynav.y = myY;
mynav.setTextFormat(format);
var navdrop:DropShadowFilter = new DropShadowFilter();
navdrop.color = 0x00;
navdrop.blurX = 3;
navdrop.blurY = 3;
navdrop.angle = 0;
navdrop.alpha = 0.5;
navdrop.distance = 3;
var navfilters:Array = new Array(navdrop);
mynav.filters = navFiltersArray;
var nsprite:Sprite = new Sprite();
addChild(nsprite);
nsprite.name = nname;
nsprite.addChild(mynav);
var len:int = mynav.numLines;
for (var i:int = 0; i  len; i++) 
{
var metrics:TextLineMetrics = mynav.getLineMetrics(i);
with(nsprite.graphics)
{
beginFill(myfill, 1);
drawRect(mynav.x, mynav.y, metrics.width + 4, 
metrics.height + metrics.descent + 1);
endFill();
}
}
addChild(nsprite);
nsprite.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler);
nsprite.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler);
nsprite.addEventListener(MouseEvent.CLICK, onClickHandler);
nsprite.addEventListener(MouseEvent.MOUSE_DOWN, onPressHandler);
nsprite.addEventListener(MouseEvent.MOUSE_UP, onReleaseHandler);
nsprite.mouseChildren = false;
nsprite.buttonMode = true;
}

function onRollOverHandler(e:MouseEvent) 
{
if (e.currentTarget.name == ' Home ') 
{
Navigation(' Home ', 'index', 235, 0x97f9ec);
}
}

function onRollOutHandler(e:MouseEvent)
{
if (e.currentTarget.name == ' Home ') 
{
Navigation(' Home ', 'index', 235, 0x0e778a);
}

function onClickHandler(e:MouseEvent)
{
mynav.textColor = 0x00;
mynav.borderColor = 0xFF;
}

function onPressHandler(e:MouseEvent)
{
if (e.currentTarget.name == ' Home ') 
{
Navigation(' Home ', 'index', 235, 0xff);
}
}

function onReleaseHandler(e:MouseEvent)
{
if (e.currentTarget.name == ' Home ') 
{
Navigation(' Home ', 'index', 235, 0x0e778a);
}
}

I can't figure out why it doesn't work online like it does in Flash. Online, 
it's all broken. Is this common? What should I do?
Thanks,
John


  
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] swf doesn't work the same online

2010-03-08 Thread Valentin Schmidt
 Hi; I built a swf that works the way I want it in Flash, but when I
 upload it, it acts differently! I built buttons in as3 like this:

your code is corrupted:

 function onRollOutHandler(e:MouseEvent)
 {
 if (e.currentTarget.name == ' Home ') 
 {
 Navigation(' Home ', 'index', 235, 0x0e778a);
 }

the IF statement is not closed!

cheers,
valentin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] swf doesn't work the same online

2010-03-08 Thread John Singleton






From: Valentin Schmidt v...@dasdeck.com
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Mon, March 8, 2010 1:48:18 PM
Subject: Re: [Flashcoders] swf doesn't work the same online

 Hi; I built a swf that works the way I want it in Flash, but when I
 upload it, it acts differently! I built buttons in as3 like this:

your code is corrupted:

 function onRollOutHandler(e:MouseEvent)
 {
 if (e.currentTarget.name == ' Home ') 
 {
 Navigation(' Home ', 'index', 235, 0x0e778a);
 }

the IF statement is not closed!

No, the if statements were closed. I just edited some stuff out and missed 
that. The code works perfectly well in the swf in my Flash, and that's what 
confuses me.
John

cheers,
valentin
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



  
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Re: swf doesn't work the same online

2010-03-08 Thread John Singleton
Here's the complete code. Again, all this works fine in my swf in Flash, but 
when I upload the swf it breaks when I roll over Home. The color changes and 
won't change back when I roll out. No other nav widget works at all. 

function nav(nname:String, nurl:String, myX:int, bgcolor:uint):void
{
myfont2 = 'Arial';
mydize = 15;
mytxtcolor = 0x00;
myborder = true;
mybordercolor = 0xFF;
myY = 170;
myfill = 0x97f9ec;
mynav = new TextField();
var format:TextFormat = new TextFormat();
format.font = myfont2;
format.size = mysize;
mynav.htmlText = 'a href=' + nurl + '.html' + nname + '/a';
mynav.textColor = myTextColor;
mynav.border = myborder;
mynav.borderColor = mybordercolor;
mynav.background=true;
mynav.backgroundColor = bgcolor;
mynav.autoSize = TextFieldAutoSize.LEFT;
mynav.x = myX;
mynav.y = myY;
mynav.setTextFormat(format);
var navdrop:DropShadowFilter = new DropShadowFilter();
navdrop.color = 0x00;
navdrop.blurX = 3;
navdrop.blurY = 3;
navdrop.angle = 0;
navdrop.alpha = 0.5;
navdrop.distance = 3;
var navfilters:Array = new Array(navdrop);
mynav.filters = navFiltersArray;
var nsprite:Sprite = new Sprite();
addChild(nsprite);
nsprite.name = nname;
nsprite.addChild(mynav);
var len:int = mynav.numLines;
for (var i:int = 0; i  len; i++) 
{
var metrics:TextLineMetrics = mynav.getLineMetrics(i);
with(nsprite.graphics)
{
beginFill(myfill, 1);
drawRect(mynav.x, mynav.y, metrics.width + 4, 
metrics.height + metrics.descent + 1);
endFill();
}
}
addChild(nsprite);
nsprite.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler);
nsprite.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler);
nsprite.addEventListener(MouseEvent.CLICK, onClickHandler);
nsprite.addEventListener(MouseEvent.MOUSE_DOWN, onPressHandler);
nsprite.addEventListener(MouseEvent.MOUSE_UP, onReleaseHandler);
nsprite.mouseChildren = false;
nsprite.buttonMode = true;
}

function onRollOverHandler(e:MouseEvent) 
{
if (e.currentTarget.name == ' Home ') 
{
nav(' Home ', 'index', 235, 0x97f9ec);
} else if (e.currentTarget.name == ' Bathroom ') {
nav(' Bathroom ', 'Bathroom', 295, 0x97F9EC);
} else if (e.currentTarget.name == ' Bedroom ') {
nav(' Bedroom ', 'Bedroom', 415, 0x97F9EC);
} else if (e.currentTarget.name == ' Dining Room ') {
nav(' Dining Room ', 'Dining_Room', 485, 0x97F9EC);
} else if (e.currentTarget.name == ' Forms ') {
nav(' Forms ', 'Forms', 642, 0x97F9EC);
} else if (e.currentTarget.name == ' About Us ') {
nav(' About Us ', 'About_Us', 703, 0x97F9EC);
} else if (e.currentTarget.name == ' Contact Us ') {
nav(' Contact Us ', 'Contact_Us', 782, 0x97F9EC);
}
}

function onRollOutHandler(e:MouseEvent)
{
if (e.currentTarget.name == ' Home ') 
{
nav(' Home ', 'index', 235, 0x0e778a);
} else if (e.currentTarget.name == ' Bathroom ') {
nav(' Bathroom ', 'Bathroom', 295, 0x0e778a);
} else if (e.currentTarget.name == ' Bedroom ') {
nav(' Bedroom ', 'Bedroom', 415, 0x0e778a);
} else if (e.currentTarget.name == ' Dining Room ') {
nav(' Dining Room ', 'Dining_Room', 485, 0x0e778a);
} else if (e.currentTarget.name == ' Forms ') {
nav(' Forms ', 'Forms', 642, 0x0e778a);
} else if (e.currentTarget.name == ' About Us ') {
nav(' About Us ', 'About_Us', 703, 0x0e778a);
} else if (e.currentTarget.name == ' Contact Us ') {
nav(' Contact Us ', 'Contact_Us', 782, 0x0e778a);
}
}

function onClickHandler(e:MouseEvent)
{
mynav.textColor = 0x00;
mynav.borderColor = 0xFF;
}

function onPressHandler(e:MouseEvent)
{
if (e.currentTarget.name == ' Home ') 
{
nav(' Home ', 'index', 235, 0xff);
} else if (e.currentTarget.name == ' Bathroom ') {
nav(' Bathroom ', 'Bathroom', 295, 0xff);
} else if (e.currentTarget.name == ' Bedroom ') {
nav(' Bedroom ', 'Bedroom', 415, 0xff);
} else if (e.currentTarget.name == ' Dining Room ') {
nav(' Dining Room ', 'Dining_Room', 485, 0xff);
} else if (e.currentTarget.name == ' Forms ') {
nav(' Forms ', 'Forms', 642, 0xff);
} else if (e.currentTarget.name == ' About Us ') {
nav(' About Us ', 'About_Us', 703, 0xff);
} else if (e.currentTarget.name == ' Contact Us ') {
nav(' Contact Us ', 'Contact_Us', 782, 0xff);
}
}

function onReleaseHandler(e:MouseEvent)
{
if (e.currentTarget.name == ' Home ') 
{
nav(' Home ', 'index', 235, 0x0e778a);
} else if (e.currentTarget.name == ' Bathroom ') {
nav(' Bathroom 

RE: [Flashcoders] swf doesn't work the same online

2010-03-08 Thread Mattheis, Erik (MIN - WSW)
What's broken about it? I recently had an issue with filters working 
differently in the browser than the authoring environment ...

_ _ _
Erik Mattheis
Senior Web Developer
Minneapolis
T  952 346 6610
C 612 377 2272

Weber Shandwick
Advocacy starts here.

PRWeek Global Agency Report Card 2009 - Gold Medal Winner
The Holmes Report Global Agency of the Year
PR News Agency of the Year

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of John Singleton
Sent: Monday, March 08, 2010 11:31 AM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] swf doesn't work the same online

Hi;
I built a swf that works the way I want it in Flash, but when I upload it, it 
acts differently! I built buttons in as3 like this:

function nav(nname:String, nurl:String, myX:int, bgcolor:uint):void
{
myfont2 = 'Arial';
mydize = 15;
mytxtcolor = 0x00;
myborder = true;
mybordercolor = 0xFF;
myY = 170;
myfill = 0x97f9ec;
mynav = new TextField();
var format:TextFormat = new TextFormat();
format.font = myfont2;
format.size = mysize;
mynav.htmlText = 'a href=' + nurl + '.html' + nname + '/a';
mynav.textColor = myTextColor;
mynav.border = myborder;
mynav.borderColor = mybordercolor;
mynav.background=true;
mynav.backgroundColor = bgcolor;
mynav.autoSize = TextFieldAutoSize.LEFT;
mynav.x = myX;
mynav.y = myY;
mynav.setTextFormat(format);
var navdrop:DropShadowFilter = new DropShadowFilter();
navdrop.color = 0x00;
navdrop.blurX = 3;
navdrop.blurY = 3;
navdrop.angle = 0;
navdrop.alpha = 0.5;
navdrop.distance = 3;
var navfilters:Array = new Array(navdrop);
mynav.filters = navFiltersArray;
var nsprite:Sprite = new Sprite();
addChild(nsprite);
nsprite.name = nname;
nsprite.addChild(mynav);
var len:int = mynav.numLines;
for (var i:int = 0; i  len; i++) 
{
var metrics:TextLineMetrics = mynav.getLineMetrics(i);
with(nsprite.graphics)
{
beginFill(myfill, 1);
drawRect(mynav.x, mynav.y, metrics.width + 4, 
metrics.height + metrics.descent + 1);
endFill();
}
}
addChild(nsprite);
nsprite.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler);
nsprite.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler);
nsprite.addEventListener(MouseEvent.CLICK, onClickHandler);
nsprite.addEventListener(MouseEvent.MOUSE_DOWN, onPressHandler);
nsprite.addEventListener(MouseEvent.MOUSE_UP, onReleaseHandler);
nsprite.mouseChildren = false;
nsprite.buttonMode = true;
}

function onRollOverHandler(e:MouseEvent) 
{
if (e.currentTarget.name == ' Home ') 
{
Navigation(' Home ', 'index', 235, 0x97f9ec);
}
}

function onRollOutHandler(e:MouseEvent)
{
if (e.currentTarget.name == ' Home ') 
{
Navigation(' Home ', 'index', 235, 0x0e778a);
}

function onClickHandler(e:MouseEvent)
{
mynav.textColor = 0x00;
mynav.borderColor = 0xFF;
}

function onPressHandler(e:MouseEvent)
{
if (e.currentTarget.name == ' Home ') 
{
Navigation(' Home ', 'index', 235, 0xff);
}
}

function onReleaseHandler(e:MouseEvent)
{
if (e.currentTarget.name == ' Home ') 
{
Navigation(' Home ', 'index', 235, 0x0e778a);
}
}

I can't figure out why it doesn't work online like it does in Flash. Online, 
it's all broken. Is this common? What should I do?
Thanks,
John


  
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Re: swf doesn't work the same online

2010-03-08 Thread Glen Pike

Hi,

   You are creating your sprites inside your nav function as local 
variables - they are probably getting garbage collected because as soon 
as nav returns nsprite will cease to exist in your code and will be 
reaped by the gc at any time the Flash Player chooses after that.


   I recommend you do something like the following which means your nav 
function returns the Sprite you create and you store it, meaning it 
won't get garbage collected.


   HTH

   Glen

//create an array of nname, nurl, strings (shortened for convenience.:
var nNames:Array = [Home, Bathroom, ...];
var nUrls:Array = [index, Bathroom, ];
var positions:Array [


//loop through the arrays and create each navigation element, then 
return it...

var numLinks = nNames.length();

var nNavs:Array = new Array();
for(var i:int = 0; i  numLinks;i++) {
   var nav:Sprite = nav(nNames[i], nUrls[i], positions[i], 0x0e778a);
   nNavs.push(nav);
   //do anything else you need to do to the nav sprite here.
}

//make nav return the sprite it creates.
function nav(...):Sprite {
   //create stuff
   //...
   //Create mynav text field with a name attribute!
   mynav.name = mynav;
   //add listeners
   //
   return nsprite;
}

function onRolloverHandler(e:MouseEvent):void {
   var nsprite:Sprite = e.currentTarget as Sprite;
   if(nsprite  nsprite.mynav) {
  TextField(mysprite.mynav).bgcolor = 0x97f9ec;
   }
}

//Repeat for the other listener handlers.



John Singleton wrote:
Here's the complete code. Again, all this works fine in my swf in Flash, but when I upload the swf it breaks when I roll over Home. The color changes and won't change back when I roll out. No other nav widget works at all. 


function nav(nname:String, nurl:String, myX:int, bgcolor:uint):void
{
myfont2 = 'Arial';
mydize = 15;
mytxtcolor = 0x00;
myborder = true;
mybordercolor = 0xFF;
myY = 170;
myfill = 0x97f9ec;
mynav = new TextField();
var format:TextFormat = new TextFormat();
format.font = myfont2;
format.size = mysize;
mynav.htmlText = 'a href=' + nurl + '.html' + nname + '/a';
mynav.textColor = myTextColor;
mynav.border = myborder;
mynav.borderColor = mybordercolor;
mynav.background=true;
mynav.backgroundColor = bgcolor;
mynav.autoSize = TextFieldAutoSize.LEFT;
mynav.x = myX;
mynav.y = myY;
mynav.setTextFormat(format);
var navdrop:DropShadowFilter = new DropShadowFilter();
navdrop.color = 0x00;
navdrop.blurX = 3;
navdrop.blurY = 3;
navdrop.angle = 0;
navdrop.alpha = 0.5;
navdrop.distance = 3;
var navfilters:Array = new Array(navdrop);
mynav.filters = navFiltersArray;
var nsprite:Sprite = new Sprite();
addChild(nsprite);
nsprite.name = nname;
nsprite.addChild(mynav);
var len:int = mynav.numLines;
for (var i:int = 0; i  len; i++) 
{

var metrics:TextLineMetrics = mynav.getLineMetrics(i);
with(nsprite.graphics)
{
beginFill(myfill, 1);
drawRect(mynav.x, mynav.y, metrics.width + 4, 
metrics.height + metrics.descent + 1);
endFill();
}
}
addChild(nsprite);
nsprite.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler);
nsprite.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler);
nsprite.addEventListener(MouseEvent.CLICK, onClickHandler);
nsprite.addEventListener(MouseEvent.MOUSE_DOWN, onPressHandler);
nsprite.addEventListener(MouseEvent.MOUSE_UP, onReleaseHandler);
nsprite.mouseChildren = false;
nsprite.buttonMode = true;
}

function onRollOverHandler(e:MouseEvent) 
{
if (e.currentTarget.name == ' Home ') 
{

nav(' Home ', 'index', 235, 0x97f9ec);
} else if (e.currentTarget.name == ' Bathroom ') {
nav(' Bathroom ', 'Bathroom', 295, 0x97F9EC);
} else if (e.currentTarget.name == ' Bedroom ') {
nav(' Bedroom ', 'Bedroom', 415, 0x97F9EC);
} else if (e.currentTarget.name == ' Dining Room ') {
nav(' Dining Room ', 'Dining_Room', 485, 0x97F9EC);
} else if (e.currentTarget.name == ' Forms ') {
nav(' Forms ', 'Forms', 642, 0x97F9EC);
} else if (e.currentTarget.name == ' About Us ') {
nav(' About Us ', 'About_Us', 703, 0x97F9EC);
} else if (e.currentTarget.name == ' Contact Us ') {
nav(' Contact Us ', 'Contact_Us', 782, 0x97F9EC);
}
}

function onRollOutHandler(e:MouseEvent)
{
if (e.currentTarget.name == ' Home ') 
{

nav(' Home ', 'index', 235, 0x0e778a);
} else if (e.currentTarget.name == ' Bathroom ') {
nav(' Bathroom ', 'Bathroom', 295, );
} else if 

[Flashcoders] Simulated load time and preloading XML

2010-03-08 Thread Lehr, Theodore
Can I put a pre-loader on XML?

Also, is there a way to slowdown load time to test a preloader? I looked at a 
movie on another machine and it loaded slowly causing things to go ascue... I 
want to be able to test it on my machine - mine is faster so I am finding it 
hard to duplicate

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Simulated load time and preloading XML

2010-03-08 Thread Kerry Thompson
Theodore Lehr wrote:

 Can I put a pre-loader on XML?

I'm not sure this is what you're looking for, but yes, you can preload
your XML. I've done it often--I load the XML from the server, and when
it's done I go about my other business. Often I'll have an XML loader
running simultaneously with other loaders. You just have to make sure
everything you need is preloaded before you start running.

 Also, is there a way to slowdown load time to test a preloader? I looked at a 
 movie on another machine and it loaded slowly causing things to go ascue... I 
 want to be able to test it on my machine - mine is faster so I am finding it 
 hard to duplicate

Use the Flash profiler.

Cordially,

Kerry Thompson
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Simulated load time and preloading XML

2010-03-08 Thread Lehr, Theodore
You just have to make sure everything you need is preloaded before you start 
running

How would I do that?


From: flashcoders-boun...@chattyfig.figleaf.com 
[flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry Thompson 
[al...@cyberiantiger.biz]
Sent: Monday, March 08, 2010 3:05 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Simulated load time and preloading XML

Theodore Lehr wrote:

 Can I put a pre-loader on XML?

I'm not sure this is what you're looking for, but yes, you can preload
your XML. I've done it often--I load the XML from the server, and when
it's done I go about my other business. Often I'll have an XML loader
running simultaneously with other loaders. You just have to make sure
everything you need is preloaded before you start running.

 Also, is there a way to slowdown load time to test a preloader? I looked at a 
 movie on another machine and it loaded slowly causing things to go ascue... I 
 want to be able to test it on my machine - mine is faster so I am finding it 
 hard to duplicate

Use the Flash profiler.

Cordially,

Kerry Thompson
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Simulated load time and preloading XML

2010-03-08 Thread Merrill, Jason
You just have to make sure everything you need is preloaded before
you start running

How would I do that?

package utils 
{
import events.XMLFileLoaderEvent;
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.net.URLLoader;
import flash.net.URLRequest;

public class XMLFileLoader extends EventDispatcher
{
public var xml:XML;

private var _xmlURL:String;
private var _urlLoader:URLLoader;

public function XMLFileLoader(xmlURL:String) 
{
_xmlURL = xmlURL;
_urlLoader = new URLLoader(new
URLRequest(_xmlURL));
_urlLoader.addEventListener(Event.COMPLETE,
onXMLLoaded); 
}

private function onXMLLoaded(event:Event):void
{
xml = new XML(event.target.data);
dispatchEvent(new
XMLFileLoaderEvent(XMLFileLoaderEvent.LOAD_COMPLETE));
}

}

}

In addition to the complete event, I would assume you can listen to the
progress events of URLLoader to get bytesloaded and bytestotal as well,
though I have never bothered with it for XML myself.


Jason Merrill 

Bank of  America  Global Learning 
Learning  Performance Solutions

Join the Bank of America Flash Platform Community  and visit our
Instructional Technology Design Blog
(note: these are for Bank of America employees only)



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders