View Full Version : External txt file in draggable pane
adewalker
01-02-2003, 10:00 AM
Hi all,
Hope I'm posting in the right place and that someone can help. I'm sure there's an easy answer - just can't figure out what it is...
I want to load an external text file into a Draggable Pane UI component.
I've created a movieclip "text_mc" which contains a dynamic text field in frame 1 of the clip and a frame action using loadVariables to access the text file. This works fine if I drag a copy of this onto the stage - text appears as expected.
What I want to do is load this movieclip into a draggable pane. I've set up a Linkage identifier for the text_mc clip called textID and set the Scroll Content parameter of the draggable pane as textID also. Doesn't work. All I get is an empty draggable pane on the stage.
Any ideas?
Thanks,
Ade.
:)
bembino
01-03-2003, 05:55 AM
I created a movieclip called textMC with a linkage identifier of the same name.
I placed a textfield on frame named "output_txt".
Then on the same frame as the textfield, inside the textMC still, I placed the following code:
textLV = new LoadVars();
textLV.onLoad = function() {
output_txt.text = this.content;
}
textLV.load("blah.txt");
Then set the scrollContent to be "textMC". Everything worked as expected.
Just realizing this...what version of the Flash 6 player are you using? I think you need the latest and greatest version (r65) in order to view dynamic text in the draggable pane component. You may be able to embed your fonts and make it work that way with older Flash 6 players.
You can get an uninstaller and an updater from the link below that will update your plug-in players, your standalone player, and your authoring players.
http://www.macromedia.com/support/flash/downloads.html
adewalker
01-03-2003, 07:26 PM
Unfortunately I can't get this code to work. I used your macromedia link to upgrade the flash player etc. Maybe I haven't fully understood what I need to do from your instructions - so here's what I did!
Created a MC named textMC.
Added a dynamic text box to the MC and gave the text field an instance name of output_txt.
Set linkage identifier of MC to textMC.
Added your code as frame action in the MC.
On main timeline added the scrollpane and set scrollcontent to textMC.
Test movie - empty scrollpane. :(
Don't know why this doesn't work.
I had a further play around and set up the MC and text box as per your method but used the following code in the MC instead:
loadVariables("textfile.txt",this);
This works - but not quite as I expected.
The text appears in the scrollpane but doesn't scroll... and seems limited to the size of the original dynamic text field in the movieclip.
Any ideas?
Thanks,
Ade
:)
bembino
01-03-2003, 07:42 PM
Can you post you FLA and txt file so I can have a peek at what you are doing? Thanks!
...or e-mail me: flashHelp@xoensix.com
adewalker
01-03-2003, 08:21 PM
Thanks,
Ade.
bembino
01-04-2003, 03:15 AM
ooops. sorry. i was in a hurry and mistyped my e-mail address. it's flashHelp@xonesix.com
bembino
01-04-2003, 07:52 AM
I forgot to mention that "content" was the name of my variable in my text file. So in order for this to work for you, you would need to replace "content" with "TextBand" like so...
textLV = new LoadVars();
textLV.onLoad = function() {
output_txt.text = this.TextBand;
}
textLV.load("textfile.txt");
That should do the trick.
adewalker
01-04-2003, 04:23 PM
bembino,
Sorted. Thanks for the help.
Ade.
:)
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.