Brandon,
Thanks, but not sure I follow you here. This is where my error occurs.
This is in response to my addChild(TileListInstanceName). You say
override the createChildren method but that is not a method and I get
errors and cannot compile in such a manner. Can you please be a little
more specific?
Thanks in advance...
The problem is that "background" is NULL because
getDisplayObjectInstance(getStyleValue('skin')) returns a NULL value.
Crazy thing but I am able to add a TileList within a FlexProject using
MXML but get the error below when going straight with Actionscript. I
know the solution has to be very simple but nothing is working. I even
tried to use the "createComplete" parameter within my default.as file
but this too does not even call the method I specify after the
createComplete event has dispatched. Nevertheless, not trying to get
sidetracked but want to let you know what I have already tried thus far.
________________________________
From: [email protected] [mailto:[email protected]] On Behalf Of Brandon
Alexander
Sent: Wednesday, July 22, 2009 1:35 PM
To: [email protected]
Subject: Re: [AFFUG Discuss] Using TileList in an Actionscript project?
You are doing this in the constructor so initialization hasn't happened
yet. Put this in an override of the createChildren method and you
should be in business.
Brandon
On Jul 22, 2009, at 1:31 PM, Marty Blood wrote:
I seem to remember from my training class that if you're instantiating
UIComponents in ActionScript you have to call their initialize method
before you can interact with them. You might give that a shot.
-Marty
On Wed, Jul 22, 2009 at 12:17 PM, Robert Green <
[email protected]> wrote:
Has anyone been able to successfully load a TileList into an
ActionScript project without using MXML?
If so, can you please help me out?
Code Snippet:
public var t:TileList = new TileList();
public function Entertainment()
{
t.x = 5;
t.y = 5;
t.addItem( {label:'Robert', data:'Roebrt'} );
t.setSize(316, 251);
t.columnWidth = 310;
t.direction = ScrollBarDirection.VERTICAL;
t.cacheAsBitmap = true;
t.allowMultipleSelection = false;
//t.horizontalScrollPosition = 30;
t.setStyle("cellRenderer", Thumb);
addChild(t);
}
ERRORS:
I am trying to simply add a TileList component to my application. The
error I am getting is that nasty Error: #1009:
Main Thread (Suspended: TypeError: Error #1009: Cannot access a property
or method of a null object reference.)
fl.containers::BaseScrollPane/drawBackground
fl.controls::TileList/draw
fl.core::UIComponent/callLaterDispatcher
After review, the error occurs in the fl/containers/BaseScrollPane.as
file on line 983. This is because the following method:
var bg:DisplayObject = background;
background = getDisplayObjectInstance(getStyleValue("skin")); // This
returns a NULL
background.width = width; // Here is the ERROR because I try to use a
property of a NULL object.
//---------------------------
I figured that this is something to do with the application trying to
draw the TileList before its time, or something to that effect. I have
no trouble adding a TileList component using Flash CS3 but in this
application it is complete as with NO Flash intervention nor any MXML
files, therefore dragging a component to the stage is not an option.
//----------------------------
Has anyone run into a similar issue. In the above example, I am simply
using an AS file attempting to add a TileList component to the stage.
When I invoke the addChild(TileListComponentInstance) is when I get the
above error. If I comment out this line (addChild) I will not get an
error.!?!?
-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in
the subject line
For more info, see http://www.affug.com <http://www.affug.com/>
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by FusionLink <http://www.fusionlink.com/>
-------------------------------------------------------------
-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in the
subject line
For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------
<<image002.jpg>>
