Adobe Dreamweaver Forums



Last 10 THreads :         Embedding Flash SWF Skin in External Site (Last Post : QADesign - Replies : 0 - Views : 1 )           »          Compatible issue with ie6 (Last Post : zhtjlong - Replies : 0 - Views : 1 )           »          Re: Photoshop CS4 is a disaster (Last Post : Paulo_Skylar@adobeforums.com - Replies : 0 - Views : 1 )           »          Query question/help (Last Post : trojnfn - Replies : 2 - Views : 3 )           »          CS4 Motion Editor issues (Last Post : aaronlyon - Replies : 4 - Views : 9 )           »          Bridge No Longer Rotates Automatically (Last Post : Michael_Palumbo@adobeforums.com - Replies : 1 - Views : 2 )           »          dollarFormat / numberformat problem (Last Post : izdabye - Replies : 0 - Views : 1 )           »          Call out side flex (Last Post : Amy Blankenship - Replies : 15 - Views : 16 )           »          captions for photos (Last Post : dc111652 - Replies : 0 - Views : 1 )           »          Re: CS4 GPU Acceleration and Intel X3100 (Last Post : Paul_B_Brown@adobeforums.com - Replies : 0 - Views : 1 )           »         


User Info Statistics
Go Back   Adobe Dreamweaver Forums > Macromedia Software > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 11-03-2008, 04:38 AM
PastaPrimavera
 
Posts: n/a
Diggs:
Default TypeError: Error #1009: Issue

I placed a TabNavigator with 2 tabs, labeled Main, Line1.
On the main page I have several TextInput boxes, I also have TextInput boxes
on the Line1 page as well.

I have a created a public function called "public function
Line1Refresh():void". In there all I do is initialize the TextInput boxes with
default values until it can connect to my sever and get the real data.
I.E. L1.text= "Please Wait";

In the parameters for Line1, I have added the "Line1RefreshI();" call to the
Creation Complete option so that when the page is done rendering, it will call
this function and fill in the blanks.
I have the same for the Main page as well initializing the TextInputs on that
page as well.

OK..... Now for the problem.....

When the Main page is finished rendering and it called MainRefresh(); I
initialize the TextInputs in there with no problems.

All worked fine until I decided to also initialize the TextInput fields in the
Line1 page.
When I did that I got a :

TypeError: Error #1009: Cannot access a property or method of a null object
reference.
at Index/ParseReceivedData()[G:\Flex3\Index\src\Index.mxml:412]
at Index/onData()[G:\Flex3\Index\src\Index.mxml:170]

Anyone know what's the deal here, why I cannot access items on a different
page ?






Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-03-2008, 04:38 AM
mhartnett
 
Posts: n/a
Diggs:
Default Re: TypeError: Error #1009: Issue

Objects in Flex are not created until they are needed. The objects in your
second tab are not yet created.

You can put creationPolicy="all" in your object definition and that will
cause all objects to be created when the parent object is created.

You can also use the event listener 'change' of the tab object to initialize
objects on the tab pages. This technique requires checking for the tab page
that is now visible and executing tab page specific code. However this
technique allows for the page to be displayed faster to the user.

If there are very few objects on the page then either the creationPolicy and
change event listener would be fine to use.


Reply With Quote
  #3 (permalink)  
Old 11-03-2008, 04:38 AM
PastaPrimavera
 
Posts: n/a
Diggs:
Default Re: TypeError: Error #1009: Issue

Thanks for the quick reply and solution!!!

Reply With Quote


  #4 (permalink)  
Old 11-03-2008, 04:38 AM
ntsiii
 
Posts: n/a
Diggs:
Default Re: TypeError: Error #1009: Issue

Don't get in the habit of using creationPolicy="all". You will regret it one day.

Tracy
Reply With Quote
  #5 (permalink)  
Old 11-03-2008, 04:38 AM
mhartnett
 
Posts: n/a
Diggs:
Default Re: TypeError: Error #1009: Issue

I agree with Tracy 100% on this. You should only use creationPolicy="all" when
absolutely necessary.

One thing I left out of my original answer was to use binding for
initialization of datafields. If you have a form or label/text data to display
on the screen then bind their text attributes to some source object and
populate the source object in the initialization process and all of your screen
and form objects will have the initialized values automatically.



Reply With Quote
  #6 (permalink)  
Old 11-03-2008, 04:38 AM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: TypeError: Error #1009: Issue


"mhartnett" <webforumsuser@macromedia.com> wrote in message
news:ge1snh$prl$1@forums.macromedia.com...
>I agree with Tracy 100% on this. You should only use creationPolicy="all"
>when
> absolutely necessary.
>
> One thing I left out of my original answer was to use binding for
> initialization of datafields. If you have a form or label/text data to
> display
> on the screen then bind their text attributes to some source object and
> populate the source object in the initialization process and all of your
> screen
> and form objects will have the initialized values automatically.


For more detail on this, see Q5
http://www.magnoliamultimedia.com/fl...s_Flex_FAQ.pdf


Reply With Quote


Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 03:56 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk