Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-26-2004, 12:05 PM   #1
Registered User
Join Date: Jun 2004
Posts: 17
Question Window Component & TextArea Inside


I have a really stupid problem.
I've got a dynamically created Window component, with a TextArea inside (in an mc called 'message_mc', and set the contentPath to message_mc).
Lets call the TextArea message_txt.

I'm unable to give the text of it after it is created.
I tried, that I can reach it from the attached movies timeline, so if I put this code to the first frame of message_mc, it is working:

ActionScript Code:
message_txt.text = "set by inline script"

If I put a regular textField next to it, and call it 'tmp_txt', I can set it's text from the Window comps 'complete' event,like

ActionScript Code:
var windowListener = new Object()     windowListener.complete = function(evtObj) {         evtObj.target.content.message_txt.text = "This is my content"         evtObj.target.content.tmp_txt.text = "this is tmp"     }         windowListener.click = function(evtObj) {         evtObj.target.deletePopUp()     }         myWindow.addEventListener("complete", windowListener)

But I can't do it with the TextArea. You can see, I try to set both the TextArea and the textfield's text in the same script, they are on the same frame, and the field get the text, the area doesn't.

BadDude is offline   Reply With Quote
Old 11-11-2004, 04:10 AM   #2
Registered User
Join Date: Mar 2004
Location: Florida
Posts: 23

Try creating the text area in AS then access it. I had a similar problem when writing custom scripts. I don't know why this is the case but I it seems to be.
N[E]rD0511 is offline   Reply With Quote
Old 11-11-2004, 05:22 AM   #3
Fried Onions
petefs's Avatar
Join Date: Apr 2004
Location: Chicago, IL
Posts: 1,328
Send a message via AIM to petefs Send a message via MSN to petefs Send a message via Yahoo to petefs

I'm not sure if this would work, but it's worth a try. It shouldn't, as the redraw on the next frame probably won't fix it.
ActionScript Code:
evtObj.target.content.message_txt.text = "This is my content" evtObj.target.content.message_txt.invalidate();

Also: what do you get from trace(evtObj.target.content.message_txt); ? or trace(evtObj.target.content.message_txt); after you set the text?

If that fails, using doLater() should work. components seem to have a one frame sort of 'summoning sickness' before they can be addresses properly.

Last edited by petefs; 11-11-2004 at 05:25 AM.
petefs is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 01:31 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.