Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-26-2004, 08:43 PM   #1
mrbrain
Registered User
 
Join Date: Dec 2004
Posts: 17
Default dynamic text in loaded movieclip

I wrote this code

Code:
on (release) {
	_root.tb1place.loadMovie("textbox.swf");
	myData = new LoadVars();
	myData.onLoad = function(){
		_level0.tb1place.textarea.text = this.barz1;
		trace(_level0.tb1place.textarea._width);
		
	};
	myData.load("barze.txt");
}

how can I put the text loaded into the textarea included in the loaded MC?
The above code does not work
mrbrain is offline   Reply With Quote
Old 12-27-2004, 08:08 AM   #2
farafiro
Addicted To FLASH
 
farafiro's Avatar
 
Join Date: Dec 2001
Location: Egyptian in UAE
Posts: 12,436
Send a message via MSN to farafiro Send a message via Yahoo to farafiro
Default

try to change this
ActionScript Code:
_level0.tb1place.textarea.text = this.myData.barz1;
if it didn't work, post the fla
__________________
‚€* GOD Is Near ‚€*
Questions Don't PM for Questions . Thanks
An eye for an eye, make the whole world blind
_____________________________________________GHANDI
farafiro is offline   Reply With Quote
Old 12-27-2004, 08:39 AM   #3
mrbrain
Registered User
 
Join Date: Dec 2004
Posts: 17
Default still not working. here come the FLAs

Sorry but it did not work.
these are the FLAs and the text file.
http://mrbrain.altervista.org/files.zip
Thanks for the help
mrbrain is offline   Reply With Quote
Old 12-27-2004, 12:54 PM   #4
farafiro
Addicted To FLASH
 
farafiro's Avatar
 
Join Date: Dec 2001
Location: Egyptian in UAE
Posts: 12,436
Send a message via MSN to farafiro Send a message via Yahoo to farafiro
Default

wrong URL, it directed me to
http://home.altervista.org/site/
__________________
‚€* GOD Is Near ‚€*
Questions Don't PM for Questions . Thanks
An eye for an eye, make the whole world blind
_____________________________________________GHANDI
farafiro is offline   Reply With Quote
Old 12-27-2004, 02:55 PM   #5
mrbrain
Registered User
 
Join Date: Dec 2004
Posts: 17
Default

URL was correct. please right click on it, copy link location and paste on the address bar.
Thanks for patience
mrbrain is offline   Reply With Quote
Old 12-28-2004, 07:45 AM   #6
farafiro
Addicted To FLASH
 
farafiro's Avatar
 
Join Date: Dec 2001
Location: Egyptian in UAE
Posts: 12,436
Send a message via MSN to farafiro Send a message via Yahoo to farafiro
Default

okey, here you go
your problem is that u r adding a script to an instance where it's not in the same frame
so, u may do this or change your animation way
ActionScript Code:
//the button's as on (press) {     _root.tb1place.loadMovie("textbox.swf"); } on (release) {     var myData:LoadVars = new LoadVars();     myData.load("barze.txt");     trace(_level0.tb1place.textarea.text);     _level0.doIt = true } //in the same frame where the buttons is var doIt = false; this.onEnterFrame = function() {     if (doIT && _level0.tb1place._currentframe>=_level0.tb1place._totalframes) {         myData.onLoad = function(done) {             if (done) {                 tb1place.textarea.text = this.barz1;             }         };     } };
__________________
‚€* GOD Is Near ‚€*
Questions Don't PM for Questions . Thanks
An eye for an eye, make the whole world blind
_____________________________________________GHANDI
farafiro is offline   Reply With Quote
Old 12-28-2004, 12:30 PM   #7
mrbrain
Registered User
 
Join Date: Dec 2004
Posts: 17
Default Thanks

Quote:
Originally Posted by farafiro
okey, here you go
your problem is that u r adding a script to an instance where it's not in the same frame
so, u may do this or change your animation way
Thanks. Now I pass the text to the MC in a variable, and when in the MC textarea is created, I give it the value of that variable. Now it works fine. Thanks for the help.
mrbrain is offline   Reply With Quote
Old 12-28-2004, 12:48 PM   #8
farafiro
Addicted To FLASH
 
farafiro's Avatar
 
Join Date: Dec 2001
Location: Egyptian in UAE
Posts: 12,436
Send a message via MSN to farafiro Send a message via Yahoo to farafiro
Default

welcome
__________________
‚€* GOD Is Near ‚€*
Questions Don't PM for Questions . Thanks
An eye for an eye, make the whole world blind
_____________________________________________GHANDI
farafiro is offline   Reply With Quote
Old 12-28-2004, 02:29 PM   #9
mrbrain
Registered User
 
Join Date: Dec 2004
Posts: 17
Default other questions

Now I can fetch variables values. I tried to do it with arrays. In the txt I wrote
foo[0]=aaa&foo[1]=bbb
but it did not work. Can u tell me why?


And when I get text from a variable, I can't display characters like Ť and ý. How can I get them?
mrbrain is offline   Reply With Quote
Old 12-28-2004, 02:36 PM   #10
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

You cannot specify the array items in the external text file like that because Flash only recognize the external data as a string... You'll have to change it to be something like this and loop through the items when the data gets fully loaded...
Code:
foo0=aaa&foo1=bbb
As for the Ť and ý... Search the forum... There are many threads that deal the same problem...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Reply


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 10:29 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.