[flexcoders] A Question of AS3 Object Equality and Collections

2007-06-14 Thread Greg McCreath
Hi All,
 
In AS3 we have only the Object, Array, and Dictionary to use for
collections (as far as I know!).  I'm posting this unless I am missing
something about how AS3 handles equality in collections.  I'm using
QName objects but I guess anything could do.  
 
Consider the following:
 
var nameSpace1: Namespace = new Namespace(http://foo http://foo );
var nameSpace2: Namespace = new Namespace(http://bar http://bar );
 
var qname1: QName = new QName(nameSpace,bob);
var qname2: QName = new QName(nameSpace,bob);
var qname3: QName = new QName(nameSpace2,bob);

trace(are equal1 : + (qname1 == qname2));
trace(are equal2 : + (qname1 === qname2));
trace(are equal3 : + (qname1 == qname3));

Gives : 
 
true
false
false
 
Good.  AS3 believes qname1  qname2 are equal, and qname2 and qname3 are
not.  Excellent.  Good start.
 
However: 
 
var a: Array = new Array();
a.push(qname1);
trace(a.indexOf(qname2)  -1);

Ooops.  They are not quite the same after all.  So, with this behaviour
different part of my framework cannot create a QName and put in an Array
for other classes to get out with their own QName objects - even though
AS3 says they are equal.
 
Perhaps I could use a Dictionary.  However it is based on '===' strict
equality and doesn't fit the bill because of that.  In fact, try adding
a QName as a key to a Dictionary like:
 
var nameSpace: Namespace = new Namespace(http://foo;);
var qname: QName = new QName(nameSpace,bar);
var d:Dictionary = new Dictionary();
d[qname] = why does this blow up?;

gives an explosion:
 
ReferenceError: Error #1056: Cannot create property http://foo::bar on
flash.utils.Dictionary.
 
you simpy cannot use a Dictionary object for QNames.  I've tried it in
10 different ways (namespaces with/without prefixes etc etc). I'll post
this separately I reckon.
 
Bottom line: Do I have to create my own collections classes (a la Java)
and use my own equality mechanisms... ?
 
All replies appreciated.
 
Greg.
 


This email and any files transmitted with it may be confidential and are 
intended solely for the use of the individual or entity to whom they are 
addressed. This email may contain personal information of individuals, and be 
subject to Commonwealth and/or State privacy laws in Australia. This email is 
also subject to copyright. If you are not the intended recipient, you must not 
read, print, store, copy, forward or use this email for any reason, in 
accordance with privacy and copyright laws. If you have received this email in 
error, please notify the sender by return email, and delete this email from 
your inbox. 


[flexcoders] Why can't I use a QName as a Dictionary key ?

2007-06-14 Thread Greg McCreath
Hi All,
 
var nameSpace: Namespace = new Namespace(http://foo http://foo/ );
var qname: QName = new QName(nameSpace,bar);
var d:Dictionary = new Dictionary();
d[qname] = why does this blow up?;

gives an explosion:
 
ReferenceError: Error #1056: Cannot create property http://foo::bar on
flash.utils.Dictionary.
 
you simpy cannot use a QName as a Dictionary key.  I've tried it in 10
different ways (namespaces with/without prefixes etc etc). 
 
Why is this so?  It extends Object ... and I can use Objects for keys in
a Dictionary.
 
All help appreciated.
 
Greg.


This email and any files transmitted with it may be confidential and are 
intended solely for the use of the individual or entity to whom they are 
addressed. This email may contain personal information of individuals, and be 
subject to Commonwealth and/or State privacy laws in Australia. This email is 
also subject to copyright. If you are not the intended recipient, you must not 
read, print, store, copy, forward or use this email for any reason, in 
accordance with privacy and copyright laws. If you have received this email in 
error, please notify the sender by return email, and delete this email from 
your inbox. 


RE: [flexcoders] Why can't I use a QName as a Dictionary key ?

2007-06-14 Thread Greg McCreath
Thanks Alex,
 
Can you explain the 'special priveledges' bit?
 
Using an object (with the same qname declaration) as below:
 
var o:Object = new Object;
o[qname] = test 1
 
gives:
 
ReferenceError: Error #1056: Cannot create property *::bob on Object.

Odd isn't it.  QName extends Object but I can't use it in collections
...
 
Greg.
 
 


  _  

From: Alex Harui [mailto:[EMAIL PROTECTED] 
Sent: Friday, 15 June 2007 1:11 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Why can't I use a QName as a Dictionary key ?



Not 100% sure, but QNames have special privileges in AS as they
generally get evaluated before applied as a property lookup.  If you do

d[http://foo::bar http://foo::bar/ ], what happens?

Also, if you apply the qname to an Object does it work?  If the
dictionary doesn't use weak keys, there's really no difference.

  _  

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Greg McCreath
Sent: Thursday, June 14, 2007 6:36 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Why can't I use a QName as a Dictionary key ?

Hi All,

var nameSpace: Namespace = new Namespace(http://foo http://foo/ );
var qname: QName = new QName(nameSpace,bar);
var d:Dictionary = new Dictionary();
d[qname] = why does this blow up?;


gives an explosion:

ReferenceError: Error #1056: Cannot create property http://foo::bar on
flash.utils.Dictionary.

you simpy cannot use a QName as a Dictionary key.  I've tried it in 10
different ways (namespaces with/without prefixes etc etc). 

Why is this so?  It extends Object ... and I can use Objects for keys in
a Dictionary.

All help appreciated.

Greg.

  _  

This email and any files transmitted with it may be confidential and are
intended solely for the use of the individual or entity to whom they are
addressed. This email may contain personal information of individuals,
and be subject to Commonwealth and/or State privacy laws in Australia.
This email is also subject to copyright. If you are not the intended
recipient, you must not read, print, store, copy, forward or use this
email for any reason, in accordance with privacy and copyright laws. If
you have received this email in error, please notify the sender by
return email, and delete this email from your inbox. 

 


This email and any files transmitted with it may be confidential and are 
intended solely for the use of the individual or entity to whom they are 
addressed. This email may contain personal information of individuals, and be 
subject to Commonwealth and/or State privacy laws in Australia. This email is 
also subject to copyright. If you are not the intended recipient, you must not 
read, print, store, copy, forward or use this email for any reason, in 
accordance with privacy and copyright laws. If you have received this email in 
error, please notify the sender by return email, and delete this email from 
your inbox. 


RE: [flexcoders] A Question of AS3 Object Equality and Collections

2007-06-14 Thread Greg McCreath
Thanks Troy,
 
I reckon a series of custom collection classes is where it is going.
String equality is not good enough, and strict equality is often not
what is required.
 
H.
 
Pity 'Object' doesn't implement equals() and hashCode() like Java eh.
(or does it somehow?)
 
Greg.

 
  _  

From: Troy Gilbert [mailto:[EMAIL PROTECTED] 
Sent: Friday, 15 June 2007 3:09 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] A Question of AS3 Object Equality and
Collections



I expect that arrays use strict equality, hence the results you're
seeing. In fact, I would assume all collections to use strict equality.
I think the only reason that there's a distinction in Object and
Dictionary is because Object *always* uses strings as keys, and thus
calls toString() on non-String objects, and thus gets a quasi equality
going on... hence the need for Dictionary which basically just never
calls toString(), resulting in the revelation that its strict equality
only. 

Am I making any sense?

So, to answer your question, I'd guess a custom collection class would
be the appropriate fix. I've run into it several times (like an ordered
collection with sparse unique ID's) where you basically have to wrap an
Array with all the appropriate access API. 

Troy.



On 6/14/07, Greg McCreath [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote: 



Hi All,
 
In AS3 we have only the Object, Array, and Dictionary to use for
collections (as far as I know!).  I'm posting this unless I am missing
something about how AS3 handles equality in collections.  I'm using
QName objects but I guess anything could do.  
 
Consider the following:
 
var nameSpace1: Namespace = new Namespace(http://foo
http://foo );
var nameSpace2: Namespace = new Namespace(http://bar
http://bar ); 
 
var qname1: QName = new QName(nameSpace,bob);
var qname2: QName = new QName(nameSpace,bob);
var qname3: QName = new QName(nameSpace2,bob);

trace(are equal1 : + (qname1 == qname2));
trace(are equal2 : + (qname1 === qname2));
trace(are equal3 : + (qname1 == qname3));

Gives : 
 
true
false
false
 
Good.  AS3 believes qname1  qname2 are equal, and qname2 and
qname3 are not.  Excellent.  Good start.
 
However: 
 
var a: Array = new Array();
a.push(qname1);
trace(a.indexOf(qname2)  -1);


Ooops.  They are not quite the same after all.  So, with this
behaviour different part of my framework cannot create a QName and put
in an Array for other classes to get out with their own QName objects -
even though AS3 says they are equal.
 
Perhaps I could use a Dictionary.  However it is based on '==='
strict equality and doesn't fit the bill because of that.  In fact, try
adding a QName as a key to a Dictionary like:
 
var nameSpace: Namespace = new Namespace(http://foo;);
var qname: QName = new QName(nameSpace,bar);
var d:Dictionary = new Dictionary();
d[qname] = why does this blow up?;

gives an explosion:
 
ReferenceError: Error #1056: Cannot create property
http://foo::bar on flash.utils.Dictionary.
 


you simpy cannot use a Dictionary object for QNames.  I've tried
it in 10 different ways (namespaces with/without prefixes etc etc). I'll
post this separately I reckon.
 
Bottom line: Do I have to create my own collections classes (a
la Java) and use my own equality mechanisms... ?
 
All replies appreciated.
 
Greg.
 



  _  

This email and any files transmitted with it may be confidential
and are intended solely for the use of the individual or entity to whom
they are addressed. This email may contain personal information of
individuals, and be subject to Commonwealth and/or State privacy laws in
Australia. This email is also subject to copyright. If you are not the
intended recipient, you must not read, print, store, copy, forward or
use this email for any reason, in accordance with privacy and copyright
laws. If you have received this email in error, please notify the sender
by return email, and delete this email from your inbox. 








 


This email and any files transmitted with it may be confidential and are 
intended solely for the use of the individual or entity to whom they are 
addressed. This email may contain personal information of individuals, and be 
subject to Commonwealth and/or State privacy laws in Australia. This email is 
also subject to copyright. If you are not the intended recipient, you must not 
read, print, store, copy, forward or use this email for any reason, in 
accordance with privacy and copyright laws. If you have received this email

[flexcoders] ASDoc with multiple source directories

2007-05-17 Thread Greg McCreath
Hi all,
 
This is driving me nuts.  How do I use ASDoc with multiple source
directories?
 
Like:
 
src1\mylib1\src ... etc etc 
src2\mylib2\src ... etc etc 
src3\mylib3\src ... etc etc 
 
plus a main project dir:
 
src\com\ etc etc
 
It seems like no combination of -doc-sources or -source-path manages to
do it without compile errors.
 
All help appreciated.
 
Greg.
 


This email and any files transmitted with it may be confidential and are 
intended solely for the use of the individual or entity to whom they are 
addressed. This email may contain personal information of individuals, and be 
subject to Commonwealth and/or State privacy laws in Australia. This email is 
also subject to copyright. If you are not the intended recipient, you must not 
read, print, store, copy, forward or use this email for any reason, in 
accordance with privacy and copyright laws. If you have received this email in 
error, please notify the sender by return email, and delete this email from 
your inbox. 


[flexcoders] E4X. Delete descendant nodes with matching attribute.

2007-03-19 Thread Greg McCreath
Hi All,
 
I'm wall bangin' over how to remove nodes from an entire XML object
where attributes have a certain value:
 
Example XML is :
 
root
additions type=group addedCount=2/
page label=Page
group1 type=group addedCount=3/
Stuff4 label=Stuff4/
Stuff5 label=Stuff5/
Stuff6 label=Stuff6/
slot1 type=separator addedCount=3/
Stuff1 label=Stuff1
stuff1 type=separator addedCount=0/
/Stuff1
Stuff2 label=Stuff2
stuff2 type=group addedCount=0/
/Stuff2
Stuff3 label=Stuff3/
/page
help label=Help/
/root

I'd just like to delete all nodes in the entire structure that have
(say) attribute type=group.  I do like E4X, I think it is very elegant
 just the docs are very light and the examples are few an' far
between.
 
All assistance appreciated.
 
Greg.
 


This email and any files transmitted with it may be confidential and are 
intended solely for the use of the individual or entity to whom they are 
addressed. This email may contain personal information of individuals, and be 
subject to Commonwealth and/or State privacy laws in Australia. This email is 
also subject to copyright. If you are not the intended recipient, you must not 
read, print, store, copy, forward or use this email for any reason, in 
accordance with privacy and copyright laws. If you have received this email in 
error, please notify the sender by return email, and delete this email from 
your inbox. 


[flexcoders] Data binding: How to detect data change has happened?

2007-03-11 Thread Greg McCreath
Hi all,

 

I'm interested to know how in an object with a data binding I can detect
a change in the datasource.

 

For example, if I were to develop (say) a custom datagrid that (in MXML)
a user of that datagrid can set the datasource property to something
like {blah.blahblah}.

 

Then, in that custom datagrid how do I detect that that blah.blahblah
has changed and take some action when it does?  In the custom component
I do not want to know of the existence of blah.blahblah, just that it
has changed and what its new value is.

 

All help appreciated.

 

Greg.



This email and any files transmitted with it may be confidential and are 
intended solely for the use of the individual or entity to whom they are 
addressed. This email may contain personal information of individuals, and be 
subject to Commonwealth and/or State privacy laws in Australia. This email is 
also subject to copyright. If you are not the intended recipient, you must not 
read, print, store, copy, forward or use this email for any reason, in 
accordance with privacy and copyright laws. If you have received this email in 
error, please notify the sender by return email, and delete this email from 
your inbox. 


RE: [flexcoders] Do I *REALLY* need Flex Data Services for WebServices?

2007-01-30 Thread Greg McCreath
Thanks all.

 

It looks like I'll have to dig more under the covers of Flex / WS than I
was expecting to.

 

Thanks again.

 

Greg.

Greg McCreath
Chief Technical Officer
TAFMO Limited
ABN:  94 109 766 592

Level 8, 342 Flinders Street
Melbourne
Victoria, 3000
Australia

http://www.tafmo.com
Ph : +61 (0) 3 9018 6824
Fax : +61 (0) 3 9018 6899
Mobile : +61 (0) 401 988 957

  _  

From: greg h [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 30 January 2007 5:01 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Do I *REALLY* need Flex Data Services for
WebServices?

 

Hi Greg,

Regarding FDS pricing, there also is the FREE (as in FREE) Flex Data
Services Express version.  A quote below regarding FDS Express is pulled
from the posting over at FlexAussie at this link:
http://tech.groups.yahoo.com/group/flexaussie/message/158
http://tech.groups.yahoo.com/group/flexaussie/message/158 

FDS Express does not have any connection limitations. With FDS Express
you can run no more 1 CPU per application (this allows multiple
applications per CPU) with no connection limitations. As your
application requires more than 1 CPU for reliability or scalability we
have a mid-level FDS offering. 

Another option may be using ColdFusion, which since version 7.0.2
supports a subset of FDS functionality.  I would need to test to confirm
that Proxying is included.

hth,

g



On 1/28/07, Greg McCreath [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote:

Hi All,

The manual says:

Note: You must use the Flex proxy, which is part of Flex Data Services,
to ensure that HTTP

status codes are returned correctly from HTTP services and web services.
On web

browsers, when a service returns any status code other than 200, Adobe
Flash Player

cannot read the body of the response. If the status code is 500 and the
body contains a

fault, there is no way to get to the fault. The proxy works around this
issue by forcing the

status code for faults to 200; the player passes the body of the
response along with the

fault intact. 

At US $6000 a pop per CPU (departmental license only - $20,000 per CPU
for enterprise license) across multiple high-availability data centers
you'd be looking down the barrel at more than US $50,000 ** to run a web
service proxy ** on a number of good machines.
 

So, does this effectively render Flex RPC services un-useable unless you
use Flex Data Services? .. unless you make the assumption that
everything always works ...

.. what happens when a non-200 status code is encountered? 

... or have I got it wrong ... ??

Greg.

  _  

 

 

 



This email and any files transmitted with it may be confidential and are 
intended solely for the use of the individual or entity to whom they are 
addressed. This email may contain personal information of individuals, and be 
subject to Commonwealth and/or State privacy laws in Australia. This email is 
also subject to copyright. If you are not the intended recipient, you must not 
read, print, store, copy, forward or use this email for any reason, in 
accordance with privacy and copyright laws. If you have received this email in 
error, please notify the sender by return email, and delete this email from 
your inbox. 


[flexcoders] Do I *REALLY* need Flex Data Services for WebServices?

2007-01-29 Thread Greg McCreath
Hi All,

 

The manual says:

 

Note: You must use the Flex proxy, which is part of Flex Data Services,
to ensure that HTTP

status codes are returned correctly from HTTP services and web services.
On web

browsers, when a service returns any status code other than 200, Adobe
Flash Player

cannot read the body of the response. If the status code is 500 and the
body contains a

fault, there is no way to get to the fault. The proxy works around this
issue by forcing the

status code for faults to 200; the player passes the body of the
response along with the

fault intact.

 

At US $6000 a pop per CPU (departmental license only - $20,000 per CPU
for enterprise license) across multiple high-availability data centers
you'd be looking down the barrel at more than US $50,000 ** to run a web
service proxy ** on a number of good machines.

 

So, does this effectively render Flex RPC services un-useable unless you
use Flex Data Services? .. unless you make the assumption that
everything always works ...

 

.. what happens when a non-200 status code is encountered?

 

... or have I got it wrong ... ??

 

Greg.



This email and any files transmitted with it may be confidential and are 
intended solely for the use of the individual or entity to whom they are 
addressed. This email may contain personal information of individuals, and be 
subject to Commonwealth and/or State privacy laws in Australia. This email is 
also subject to copyright. If you are not the intended recipient, you must not 
read, print, store, copy, forward or use this email for any reason, in 
accordance with privacy and copyright laws. If you have received this email in 
error, please notify the sender by return email, and delete this email from 
your inbox. 


RE: [flexcoders] Newbie: Why can't I add a button!

2006-11-17 Thread Greg McCreath
Thanks very much for responding Gordon,   I appreciate your's and Matt's
time.

 

Why AS3?  Comfort zone I guess.  I'm coming from a Java background.  I'm
investigating the feasibility of creating an Eclipse like plug-in
framework for adding new screens and functionality that extend a solid
framework core.  The aim?  Having our P/S people being able to added
customer-specific screens and functionality and so on into a
standardized production framework without having to jump through
Struts/JSP/EJB/deployment hoops.

 

I'm pretty familiar with Eclipse having some plug in work there and I
guess that model is my starting point.

 

I'll look further into the XMXL side while I investigate.  Thanks.

 

Greg.

 

PS. If such an architecture already exists for Flex, then do tell!

 

Greg McCreath
Chief Technical Officer
TAFMO Limited
ABN:  94 109 766 592

Level 8, 342 Flinders Street
Melbourne
Victoria, 3000
Australia

http://www.tafmo.com
Ph http://www.tafmo.comPh  : +61 (0) 3 9018 6824
Fax : +61 (0) 3 9018 6899
Mobile : +61 (0) 401 988 957

  _  

From: Gordon Smith [mailto:[EMAIL PROTECTED] 
Sent: Friday, 17 November 2006 3:24 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Newbie: Why can't I add a button!

 

Sorry, although we've made it easy to write components in either MXML or
AS3, we haven't done the same with Application. If you are a newbie you
should start out with mx:Application in MXML. You can then use AS3 for
all your components if you really want to. I hope we can make this
better in a future release.

 

What's going on is that when the MXML compiler compiles an
mx:Application it autogenerates code to set up a lot of stuff such as
the default CSS type selectors that various components like Button
depend on. These aren't getting set up when you simply extend
Application as an AS3 class. When Button calls getStyle() to find out
what it's skin class should be, it's getting a null Clas reference.

 

Once you are no longer a newbie, you can use mxmlc's
-keep-generated-actionscript option to see all the generated code, and
set this stuff up yourself it you insist. But I really don't understand
why some developers like AS3 so much better tham MXML. Would you write a
web app all in JS and no HTML?

 

- Gordon

 

  _  

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of bookymcnuggett
Sent: Thursday, November 16, 2006 5:49 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Newbie: Why can't I add a button!

 

Hi All,

This is my first posting to this forum.

I have taken my first newbie steps to creating a stand-alone AS3 
Application and have come across something I cannot understand. I 
have an Application, and add an Image to it and it is fine. I add a 
Button to it and it blows up with the AS3 equivalent of a null 
pointer exception. The code is below. The error is below that. If I 
comment out the line that does the addChild(button) it correctly 
adds and displays the Image. What am I doing wrong? What is wrong 
with how I am adding a button? Both Button and Image descend from 
UIComponent.

package {

import mx.core.*;
import mx.events.*;
import mx.skins.halo.*;
import mx.styles.*;
import mx.controls.*;
import flash.display.*;

public class FirstApp extends Application
{
[Embed(source=connected_multiple_big.jpg)]
private var ImageClass:Class;

public function FirstApp()
{
super();
this.layout = vertical;
this.setStyle(borderSkin,mx.skins.halo.HaloBorder);
this.addEventListener(FlexEvent.APPLICATION_COMPLETE, doInit); 
}

private function doInit(e:FlexEvent):void {
var img:Image = new Image();
img.setStyle(verticalAlign,top);
img.source = ImageClass; 
addChild(img);

// the troublesome test button. addChild() here causes a null object 
reference exception
var button:Button = new Button();
button.label = label;
addChild(button); 

}
}
}
/// 

TypeError: Error #1009: Cannot access a property or method of a null 
object reference.
at mx.core::UIComponent/getStyle()
at 
mx.controls::Button/http://www.adobe.com/2006/flex/mx/internal::viewS
http://www.adobe.com/2006/flex/mx/internal::viewS 
kinForPhase()
at 
mx.controls::Button/http://www.adobe.com/2006/flex/mx/internal::viewS
http://www.adobe.com/2006/flex/mx/internal::viewS 
kin()
at mx.controls::Button/mx.controls:Button::commitProperties()
at mx.core::UIComponent/validateProperties()
at mx.managers::LayoutManager/::validateProperties()
at mx.managers::LayoutManager/::doPhasedInstantiation()
at Function/http://adobe.com/AS3/2006/builtin::apply
http://adobe.com/AS3/2006/builtin::apply ()
at mx.core::UIComponent/::callLaterDispatcher2()
at mx.core::UIComponent/::callLaterDispatcher()
at 
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchE
ventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.managers::SystemManager/::preloader_preloaderDoneHandler()
at 
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchE
ventFunction

[flexcoders] Newbie: Why can't I add a button!

2006-11-16 Thread Greg McCreath
Hi All,

This is my first posting to this forum.

I have taken my first newbie steps to creating a stand-alone AS3
Application and have come across something I cannot understand. I have
an Application, and add an Image to it and it is fine. I add a Button to
it and it blows up with the AS3 equivalent of a null pointer exception.
The code is below. The error is below that. If I comment out the line
that does the addChild(button) it correctly adds and displays the
Image. What am I doing wrong? What is wrong with how I am adding a
button? Both Button and Image descend from UIComponent.

package {

import mx.core.*;
import mx.events.*;
import mx.skins.halo.*;
import mx.styles.*;
import mx.controls.*;
import flash.display.*;

public class FirstApp extends Application
{
[Embed(source=connected_multiple_big.jpg)]
private var ImageClass:Class;

public function FirstApp()
{
super();
this.layout = vertical;
this.setStyle(borderSkin,mx.skins.halo.HaloBorder);
this.addEventListener(FlexEvent.APPLICATION_COMPLETE, doInit); 
}

private function doInit(e:FlexEvent):void {
var img:Image = new Image();
img.setStyle(verticalAlign,top);
img.source = ImageClass; 
addChild(img);

// the troublesome test button. addChild() here causes a null object
reference exception
var button:Button = new Button();
button.label = label;
addChild(button); 

}
}
}
/// 

TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at mx.core::UIComponent/getStyle()
at
mx.controls::Button/http://www.adobe.com/2006/flex/mx/internal::viewSkin
ForPhase()
at
mx.controls::Button/http://www.adobe.com/2006/flex/mx/internal::viewSkin
()
at mx.controls::Button/mx.controls:Button::commitProperties()
at mx.core::UIComponent/validateProperties()
at mx.managers::LayoutManager/::validateProperties()
at mx.managers::LayoutManager/::doPhasedInstantiation()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/::callLaterDispatcher2()
at mx.core::UIComponent/::callLaterDispatcher()
at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEven
tFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.managers::SystemManager/::preloader_preloaderDoneHandler()
at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEven
tFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.preloaders::Preloader/::displayClassCompleteHandler()
at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEven
tFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.preloaders::DownloadProgressBar/::timerHandler()
at mx.preloaders::DownloadProgressBar/::initCompleteHandler()
at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEven
tFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.preloaders::Preloader/::dispatchAppEndEvent()
at mx.preloaders::Preloader/::appCreationCompleteHandler()
at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEven
tFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/set initialized()
at mx.managers::LayoutManager/::doPhasedInstantiation()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/::callLaterDispatcher2()
at mx.core::UIComponent/::callLaterDispatcher()

 

Greg McCreath
Chief Technical Officer
TAFMO Limited
ABN:  94 109 766 592

Level 8, 342 Flinders Street
Melbourne
Victoria, 3000
Australia

http://www.tafmo.com
Ph http://www.tafmo.comPh  : +61 (0) 3 9018 6824
Fax : +61 (0) 3 9018 6899
Mobile : +61 (0) 401 988 957

 



This email and any files transmitted with it may be confidential and are 
intended solely for the use of the individual or entity to whom they are 
addressed. This email may contain personal information of individuals, and be 
subject to Commonwealth and/or State privacy laws in Australia. This email is 
also subject to copyright. If you are not the intended recipient, you must not 
read, print, store, copy, forward or use this email for any reason, in 
accordance with privacy and copyright laws. If you have received this email in 
error, please notify the sender by return email, and delete this email from 
your inbox.