Load Text Into Swf Movie
when a button is pressed how would i load a txt file onto stage.
FlashKit > Flash Help > Flash General Help
Posted on: 09-18-2004, 05:48 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Load Text With Load Movie Clip
Guess I'm dealing with some sort of "root" thing, which I don't understand. I have a movie-clip being loaded into a target on the main scene. This movie-clip features a text-box with external TXT file being loaded into it. Well, it doesn't load. In the actions box, what should it say?
loadVariablesNum("myText.txt", 0);
That's what I have at the moment, but "0" obviously isn't working. Also, should it be "target" or "level?" The instance name of my textbox is "scrolltext."
Thanks for the help, I only know enough to be dangerous.
Load Text From Text File, INSIDE A Movie Clip...
Hi, I'm making this website, and I want to have a news section on it, and therefore I have to load some text from an external text file. This works fine when I try it out in a new, blank movie, but on my page, I have to have the whole Text Field inside an MC, and this is where it all goes wrong....
Nothing shows up at all when I do exactly the same in the MC as I do on the mainstage...
I don't blame u if you didn't understand what I was talking about
Hope someone has an answer!!
Thomas
How To Load Text From Text File To Falsh Movie
How can we load text from text file to flash movie, so that next time you just modify the content of text file without modifying the movie for different text message on the same movie clip.
Why Does My Text Load Just Fine In Movie A But Not In Movie B
Hello,
Well last post concerned my Writers index (XML menu)
that's solved right now... but here i am with a new problem
In the Prev version of stopfortuyn.nl the texts where dynamicly loaded but the menu i created needed constant updating .. so (this version works just fine but i wanted to dynamicly load everythig into the site (even the buttons) .... well got this part working but when i klick the button which has the largest text to load (1066 words)
works in version 1 but not in the totaly dynamic version... what went wrong??????
please help me ou here...
URL for Version 1 http://www.stopfortuyn.nl (first menu option - a new menu will open, displaying the list of writers - choose Mercita Coronel -- so the submenu expands -- choose the text ... youll see the text just loads as it's supposed to...(version 1 = Flash MX you might need to install the new player)
URL for version 2 http://24.132.18.218:8080/fkindex.html
do the same as you did with version 1 .. youll see the text wont load........
Load Movie And Text
I am using the Load Movie action to load swf files into blank movie clips. The problem that I am having is with the text. The text will only be displayed if it is "static text" with out using device fonts.
What can I do about getting around this problem so I do not have to resort to using a pop-up?
Load Movie If XML.text = 16
Hi everybody :D, Hope you can help me here ...
Should be fairly simple but I cant get my movies to load depending on the dynamic XML data which I load into dynamic text boxes ... check this out :D
thanks for your help !!!
Attach Code
stop();
var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(success) {
if (success) {
for (var x = 0; x<this.firstChild.childNodes.length; x++) {
var Node:XMLNode = this.firstChild.firstChild.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling;
//: var Node:XMLNode = this.firstChild.firstChild.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.childNodes[x];
w1.text = Node.nextSibling.nextSibling.attributes.chill;
w2.text = Node.nextSibling.nextSibling.attributes.speed;
w3.text = Node.nextSibling.nextSibling.attributes.direction;
w4.text = Node.nextSibling.nextSibling.nextSibling.attributes.humidity;
w5.text = Node.nextSibling.nextSibling.nextSibling.attributes.pressure
w6.text = Node.nextSibling.nextSibling.nextSibling.nextSibling.attributes.sunrise;
w7.text = Node.nextSibling.nextSibling.nextSibling.nextSibling.attributes.sunset;
w8.text = Node.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.nextSibling.firstChild;
w9.text = Node.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.nextSibling.nextSibling.firstChild;
day1.text = Node.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.attributes.day;
condition.text = Node.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.attributes.text
oode.text = Node.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.attributes.code
day2.text = Node.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.attributes.day;
}
}
};
myXML.load("http://weather.yahooapis.com/forecastrss?p=SPXX0065&u=c");
weatherMovieLoader = function () {
if ((w2.text >= 1) && (w2.text <= 20)) {
wind_mc.loadMovie("movies/windWeak.swf")
} else if ((w2.text >= 20) && (w2.text <= 30)) {
wind_mc.loadMovie("movies/windMedium.swf")
} else if ((w2.text >= 30) && (w2.text <= 40)) {
wind_mc.loadMovie("movies/windStrong.swf")
}
}
Dynamic Text/load Movie
hello all, I was wondering if anyone could please explain
to me what I might be doing wrong here:
I have a swf that contains dynamic text that scroll.
I am attempting to load this swf into my main movie using an empty movieclip on the main stage. When I do this, the scroll buttons load, but no text.
Whenever I use loadvariable(something.html,0) the text loads into the swf that contains the scroll, but when I call it to main via a button in main, no text.
if I use loadvariables (something.html,_root.empty3) the text loads into the main movie but the scroll won't work.
any solutions would greatly appreciated.
thanks
Load Movie/dynamic Text
This time I'll add a little actionscript to my question. Hopefully someone can tell me what I'm doing wrong. Any help would be appreciated;
I have a movie that has external dynamic text loaded into it. This dynamic text is also set-up to scroll up or down. When I view this movie by itself it works fine. What i need it to do though is load into an empty movie clip that is on what I consider my main stage. When I try to load it on my main stage, the scroll buttons appear but not the actual text.
in the swf with the dynamic text it is coded:
loadvariablesNum ( our historya.html,0)
the button that I use to load it into is on the main stage
it is coded:
on release
loadmovie (ourhistory.swf,empty1)
again what happens is that the buttons in the loaded movie that allows you to scroll the dynamic text box shows up, but no text is visible.
Can anyone please help me?
Load Movie With A Text File
hi, i have my main movie . then i have another movie ( a seperate swf) that loads a .txt file ... do i have to do any specific targeting to get it to work ?? .. both movies work on their own , but when i try to load the movie with the text it doesnt play in my main movie ?!?!? something is happinin becuase if i change or remove the instance name of the clip i want it to load into then i can clearly see the square where it should go ...
does the other movie with the text function independantly so i only need reference the files it needs with it ?? i thaught that was the case ? any ideas ???
cheers flashers
Load Text Into Movie Clip
Anyone know how to load a text file into a movie clip? I've got it to load into a swf, but not into a movie clip in the swf. Something to do with levels or paths?
Dyn. Text Will Not Load Into Loaded Movie
I am using loadVariablesNum to load an external txt file into a movie that is being loaded into my main movie and the text will not load into my main swf file. The text shows up in the loaded swf file but not the main movie. Make sense? What am i doing wrong? All of the files are stored in the same folder so thats not it.
I am just using the basic script
loadVariablesNum("text.txt", 0);
Load Text In A Loaded Movie?
Ok I have a index.swf/html
button that has the code on click even load news.swf
News.swf has its own load variable to load text.txt ( IN A SCROLL BAR) such as the one demonstrated here. http://www.macromedia.com/support/fl...t_scrollmx.htm
When I click the news button the text doesnt load at all. When I open just the news.swf by its self, it loads fine.
WHATS THE DEAL?
Load A Movie With Dynamic Text
Is there a way to load a movie onto a specific layer using Dynamic text. i.e. click on a dynamic link on say level 0 that will load a flash movie onto level 1, using an href???
Rob
Xccelerant.com
Help. Load Movie From A Scrolling Text Box
I have a scrolling text box, using an external txt file, that contains a list of file names. (got the scrolling text box from a tutorial on this site!)
I need the file names to be clickable, to load a movie on a different layer.
I've never done this before so I'm not sure if its possible!
Yo can check out where I am so far at http://www.thinairdesign.co.uk/lunson/data/news.swf
a default movies loads up when opened which should be replaced when the viewer clicks on the list.
Please, any help!
Load Movie And DYNAMIC Text
hey..
i made a simple movie clip.. 10 frame animation and than a dynamic text box appears.. gettin the text from a TXT file.. works fine...
but
when i call this SWF in another SWF the animation works but TEXT DOEST DISPLAY? why not.. n e idea... THE PATH of the text file is ok.. they r all in the same folder.
thnx
aLi
Load .htm File In A Movie As Text
Hi everybody, i was wondering if there is any way to load in a text box an html page as text.
If it is not possible is there any way to load the html page and see it`s source code?
How To Load Random Text Into Movie, But...
I have created a button that loads random txt into a dynamic txt box.
Works a treat. But I want to put the button within a movie. When I do this, it no longer works. Can anyone help?
(Is there a problem with scripts generally when buttons are placed within movies??)
//this is the script in the txt file, randinfo.txt //
textField=Dynamic text
name1= first line of text
&name2= second line of text
&name3= third line of text
&name4= fourth line of text
&name5= fifth line of text
&name6= sixth line of text
&numnames=6
//this is the script in the button, the dynamic txt field is named random.name //
on (press) {
loadVariablesNum ("randinfo.txt", 0);
count = Number(random(numnames))+1;
_root.randomname = eval("name" add count) ;
stop ();
}
How To Load Random Text Into Movie, But...
I have created a button that loads random txt into a dynamic txt box.
(see attached fla)
Works a treat. But I want to put the button within a movie. When I do this, it no longer works. Can anyone help?
(Is there a problem with scripts generally when buttons are placed within movies??)
//this is the script in the txt file, randinfo.txt //
textField=Dynamic text
name1= first line of text
&name2= second line of text
&name3= third line of text
&name4= fourth line of text
&name5= fifth line of text
&name6= sixth line of text
&numnames=6
//this is the script in the button, the dynamic txt field is named random.name //
on (press) {
loadVariablesNum ("randinfo.txt", 0);
count = Number(random(numnames))+1;
_root.randomname = eval("name" add count) ;
stop ();
}
Load ASP Text Into Flash Movie
Hi,
I'm trying to load some text into a Flash movie. The text comes from an ASP page which generates specific text depending on an Id value passed in from the Flash movie.
Basically, the ASP page is like this:
Code:
<%
intId = request.querystring("Id")
response.write "output=Some text - id number=" & intId
%>
This is called from the Flash movie by:
Code:
loadVariables("terms_game.asp?CompId=1", "scr_all.txt_field");
This works with a standard '.htm' page, but as soon as I add ASP code into the called page, nothing appears in the Flash movie.
If anyone can help with this it'd be most appreciated, thanks.
Load Movie Through Input Text
I am designing a huge Flash catalog where each page is a seperate SWF, named by page number, for example Page 5 of the catalog is 5.swf. I want to enable the user to enter a page number into an Input Text field and have the (page number).swf load, after clicking a button.
I have the code for loading the movie below.
on (release) {
_root.loadMovie("5.swf");
}
I know that I should assign a variable to the Input Text field, then that variable is passed into the code that should replace "5".
In summary: User enters a page number into an Input Text field, clicks the button, that number is passed into the code and loads the movie.
Thanks
Dynamic Text And Load Movie
I have a main Flash movie that loads a series of other .swf into a target clip using loadMovie("myMovie.swf",targetClip).
Some of the other .swfs contain dynamic text boxes. When you play these .swf's independently, the text shows up fine. But when they are loaded into the main movie, the text disappears.
I suspect that it is the way I'm referring to the text. The text box (txtCredit) has a variable (sCredit), which I'm calling by using this.sCredit = "text".
I've also tried just referrring to the text box itself (this.txtCredit.htmlText = "text") and that doesn't work either. I've also tried changing the this to _root.targetClip and _parent. None of that worked.
Does anyone know how i can get the text to show up when the main movie plays?
Help With Dynamic Text And Load Movie
Hi, I need help with a flash site I'm making
I have a dynamic text that has a scrollbar component, and I need some parts of that text to trigger some loadmovie's.
For example, a certain part of text must link to something like this:
loadMovieNum("G2_7.swf", 1);
I thought that maybe rendering the text as html, there might be a way to tell the text to load a movie inside that same flash movie, but I haven't been able to do it yet...
Is there any way to do this or is it just impossible? in that case, could you suggest me a solution?
Making the text static is not an option as I need it to run under a scrollbar component.
Thanks in advance
Load Other Text File Types Into A Movie
I think I know the answer to this anyway, but it's doesn't harm trying.
I am aware that it is possible to load text from a text file into a Flash movie, but can word documents be used to load into text into a Flash movie? I think not because Flash will not be able to recognise the formatting used by Word, whereas text files have no formatting.
Could you confirm this for me.
Thanks
Steve
Load Text Into A Duplicated Movie Clip
how do i tell a tell text to go to a specific dupliaceted movie clip
HERE IS MY DUPLICATE ACTION
Code:
for (var r = 0; r<4; r++) {
for (var c = 0; c<7; c++) {
bn = "date"+(++n);
duplicateMovieClip("date", bn, n);
setProperty(bn, _x, Number(getProperty(bn, _x))+Number(c*(getProperty(bn, _width))));
setProperty(bn, _y, Number(getProperty(bn, _y))+Number(r*(getProperty(bn, _width))));
}
}
now i want to give a text box within one of the duplicated movie clips a certain peice of text to make it different from others. and i will want to edit each one seperatly
54
Dynamic Text Load In Movie Clip
I a movie clip (_root.movie) with a dynamic text field inside of it. when I use "loadVariablesNum" is there a certain level that I need to use for it to work? If not why can't I get my text to load. Script looks like this:
(on _root.members)
onClipEvent (load) {
loadVariablesNum("./texts/members.txt", 0);
this.scaleDest = 5;
this._x = 0;
this._y = 0;
}
All the other stuff is for an inertia gig I'm working on so you can ignore it.
Thanks,
Tchus,
Load Movie From Dynamic Text Field
Hi
Hope this is an easy one!
My site has a main movie with multiple movies loading above it on different levels,
On my main movie I have a scrolling text field and I'm trying to hot link parts of the text in this field to load a movie above it in say level 2.
Is there any way of adding a button into a dynamic text field or using the getURL action? any suggestions would be appreciated.
Site: www.meinthepark.com
Cheers
Input Text Not Working Load Movie.
Ok I have a contact page with a form on, and the movie works fine.
However when the contact movie is loaded into the main movie the input text stops working, any ideas?
Thanks in advance for the help.
Load Movie And Dyno Text Disappears...what The?
Okay.
I finally got this dynamic text box working in a flash document (YAY i also made it scroll *happy*) but when i load this swf into another movie the text doesnt appear...Help would be much appreciated. It will probably be loaded onto: beanie-dude.50webs.com
cheers
Won't Load Text For 2nd Page. (movie Attached)
I don't know what I'm doing wrong, I've been trying to figure this out for a long time.I'll paypal $5 if someone can figure this out. Thanks.
So basically I have two .swf files so far, one for "Home" and one for "Bio". The load text works for the "Home" page but doesn't work for "Bio". It works when I'm testing it on preview or viewing just the .swf by itself but doesnt work from the "Home" page.
Here's the site:
http://www.peterjun.com/websites/chops/chops.html
Heres the code on the "Home" page for the text load.
Code:
//creates a new loadVars object that will load the text
var myLV:LoadVars = new LoadVars();
myLV.onLoad = function(success) {
if (success) {
loadedInfo.htmlText = myLV.info;
_root.loadedInfo.scroll = 1;
_root.scrollTrackbar.scrollBar._y = 0;
scrollCheck();
} else {
loadedInfo.text = "There has been an error loading the requested information. Please contact the Webmaster and report your error.";
}
};
//automatically starts the loading of "page1.txt" when the movie loads
myLV.load("page2.txt");
And here's the code for the "Bio" page for the text load.
Code:
//creates a new loadVars object that will load the text
var myLV2:LoadVars = new LoadVars();
myLV2.onLoad = function(success) {
if (success) {
loadedInfobio.htmlText = myLV2.info2;
_parent.loadedInfobio.scroll = 1;
_parent.scrollTrackbar.scrollBar._y = 0;
scrollCheck();
} else {
loadedInfobio.text = "There has been an error loading the requested information. Please contact the Webmaster and report your error.";
}
};
//automatically starts the loading of "page1.txt" when the movie loads
myLV2.load("page002.txt");
stop()
I think I named all the variables correctly since it works when I preview or view the swf by itself.
Scrolling Text And Load Movie Questions
Question 1:
I have a dynamic text box in a movie clip that contains a single line of text. I load the text from an outside text file. My goal is to make the text box act like a news ticker. I wish to make it automatically scroll from right to left (text will move left on the screen), and upon "mouse rollover" to stop scrolling. When the text box gets to the end of the text it starts scrolling again from the beginning with a small delay.
I have looked at many tutorials on how to make vertical scrolling text boxes, but I cannot figure out how to modify the script to fit my horizontal text box. I am not much of a programmer (I prefer the graphic designing aspect) so I cannot make a script on my own.
Question 2:
Also, I have a relatively general question. I have 3 movies (A,B,C) and I wish to connect them in the following sense. In Movie A I have a button that when you roll over it, it triggers a “LoadMovie” command and opens up a popup menu (Movie B). From Movie B I want to make it such that if you press on a button in the menu it links back to Movie A, and opens up Movie C in a "LoadMovie" field in Movie A. Is this even possible to do, and if it is how would I do it?
Dynamically Load Text Into Movie Instance
I have looked all over for a way to do this and can't seem to find one.
I have a movie clip with a text box in it. I want to place three instances of this movie clip on a web page and have each instance have different text in the text box. The instances are menu choices, so I want each on them to open a new web page.
My question is, how can I dynamically load different tet into each instances text box.
P.S. I am fairly new to flash.
Prototype To Load Movie From Dynamic Text
Hi Guys,
I try to use the following prototype to load movieclip from dynamic text :
Code:
Movieclip.prototype.load_my_movies = function(moviename) {
loadMovieNum (moviename, 1);
};
I put the following code in the external html text like this:
Code:
<a href='asfunction:load_my_movies,movie01.swf'>Movie1</a>
But that code will load the movie to the level 1, NOT exactly what I wanted. Instead, I want to load the movie to targeted empty movie clip called "container".
I have changed the prototype like this but it doesn't work:
Code:
Movieclip.prototype.load_my_movies = function(moviename) {
loadMovieNum (moviename, "container");
};
Anybody can help me? Thanks a lot in advance.
PS:
Yes, I have search the forum and Macromedia of "asfunction" but I really can't find a help of my problem
Load Movie And Dynamic Text Disappears...what The?
i dont understand. I have a swf which the dynamic text works perfect on. I use the loadMovie and load in the swf with the text, and the text doesnt appear. Can anyone help. beanie dude
goto the link to see the thingo..press enter and goto characters...
(please ignore the silly voice and my noobiness at flash)
Jpeg & Text Expand With Load Movie
Hi folks!
I'm new to this great forum and I've just finished experimenting with Kirupa's tutorial on loading movies:
http://www.kirupa.com/developer/mx/full_site2.htm
Very cool and straightforward tut, but I have a problem applying it to my website.
Please view what I am attempting to accomplish first so my question makes sense (the site is in its EARLY stages!):
http://education.concordia.ca/~CECILE.EGOU/
Please click on the link "Employment"
Basically, the movie loads into the clip, but the jpeg and text (which are grouped) expand;
How can I keep them to the original size?
How can I load movies (.swf) of different lengths and have a scroll bar for the whole page, not for the clip box (where the movie is loaded)?
I also read the message from Exedus on Hyperlinks in Flash, but I want to build a 100% Flash site.
Thanks in advance for your help.
Sissou
On Release.....text Fade And Load Movie?
I have a button..that at the moment loads a movie. However I need the button to fade text then load movie!! Is it as simple as combining these twp pieces of action script? How do I go about altering this to work?
on (release)
{_root.loadMovie
("profile2.swf");
}
bodycopy._alpha = 0;
onEnterFrame = function () {
if (bodycopy._alpha<100) {
bodycopy._alpha += 10;
}
}
Thank you
Load Movie Hides Dynamic Text
Here's my issue. I have created a swf w/ dynamically loaded html text. When I test, it works fine. I then load this swf into another swf file, everything works great, except my dynamic text is gone. The text box is there, but the text is gone. I can mouseover and it looks like text is selectable, but there's nothing there. I'm using LoadVars to load the text and laodmovie to load the swf fileinto the parent swf. Has anyone seen this before?
Prototype To Load Movie From Dynamic Text
Hi Guys,
I try to use the following prototype to load movieclip from dynamic text :
Code:
Movieclip.prototype.load_my_movies = function(moviename) {
loadMovieNum (moviename, 1);
};
I put the following code in the external html text like this:
Code:
<a href='asfunction:load_my_movies,movie01.swf'>Movie1</a>
But that code will load the movie to the level 1, NOT exactly what I wanted. Instead, I want to load the movie to targeted empty movie clip called "container".
I have changed the prototype like this but it doesn't work:
Code:
Movieclip.prototype.load_my_movies = function(moviename) {
loadMovieNum (moviename, "container");
};
Anybody can help me? Thanks a lot in advance.
PS:
Yes, I have search the forum and Macromedia of "asfunction" but I really can't find a help of my problem
How Can I Load Variables (text) Directly Into Movie Clip
Hello, I have a problem loading text variable directly into MC (text) into textfield (bar)
the script I used on Main timeline is :
loadVariables ("crimea.txt", _level0.text.bar);
have any ideas what's wrong with it,
-thanks-
Movie Search & Load Using Text Input Fields...HOW ?
Im developing a site in flash 5 for a second hand car seller, i need to be able to have a search box so that the customer can type in the car they are looking for.. ie "ford escort" i want flash to then bring up a list of cars available i then want to be able to click on the car text to load up the car movie......how can this be done ???
How To Load An Html Or Text Document Over A Flash Movie
Hello,
I am trying to load the text from either a standard *.txt file or the data from a *.html file on to level 1 or 2 of a movie. I have already got an action on level one:
startDrag ("/crsInvi", true, 0, 100, 800, 355);
So I tried at first using :
unloadMovieNum (2);
loadVariablesNum ("test.html", 2);
When this failed to do anything except stop the action on level one working, I tried:
unloadMovieNum (1);
loadVariablesNum ("test.html", 1);
again, nothing! Can anyone please tell me how I can load up an html file over this movie, the background is black, and so the text must be white or beige.
Any help woyuld be most appreciated...
Yours Sincerely
joe
Loaded Movie >need To Load External Text Into Scroller
Ok site.swf loads a news.swf on click, the test.txt is loaded into news.swf (scrolling text) However when I play the news.swf by itself, the text loads fine. When I play it all together, the text does not load. Here is the code in site.swf to load the swf into a movie clip (instance name.... loaded)
on (release) {
loadMovie("news.swf", "loaded");
}
Script from the news.swf to load the external text file.
loadVarsText = new loadVars();
loadVarsText.load("test.txt");
// assign a function which fires when the data is loaded:
loadVarsText.onLoad = function(success) {
if (success) {
trace("done loading");
// Now that we know the data is loaded,
// it sets the text content of the Text Field
// with the instance name "scroller" equal to the
// contents of the variable
scroller.text = this.var1;
} else {
trace("not loaded");
}
};
Can someone please help me out? I posted in FLASH MX but figured this was more suitable for actionscripting. Im getting lil restless with this thing.
Trying To Load Swfs Into Existing Movie From Html Text
i'm hoping somebody can tell me if there is a way to have a dynamic text field with html enabled that can have a link which will target a clip in the flash movie and be able to load another swf into it. basically the problem is:
dynamic text field on screen in flash containing html-formatted text. the link in the text when clicked needs to fetch a swf file on the server and load it into a clip in the flash movie already onscreen.
please help!!!!
[F8] External Text Won't Load If It's Inside Movie Clip
Quote:
Originally Posted by egoldin
Hi all,
So I've searched the forums and found a few people having the exact same problem I'm having. However, none of them every got their question quite figured out, so here goes:
I have two swfs, a Master file and an About file. The About file is loaded into the master file using a MyMCL clip loader. In the about file, I want to load external text into a text box, and I've tried doing this using loadVars. The problem is, the text box is located INSIDE of a movie clip in the about file (as I want the text to appear after my animation has finished). And this makes my coding not work.
I know that it's the purely the fact that the text box is inside the movie clip that breaks the coding because I have placed a dummy text box on the About stage, and when i play master.swf I can see the text load in that box.
Here's my loadVars code located in frame 1 of master.swf:
PHP Code:
// -------- <load vars> ------ \
var myLV:LoadVars = new LoadVars();
myLV.onLoad = function (success:Boolean) {
if (success) {
_level5.loadedInfo.htmlText = myLV.info;
} else {
_level5.loadedInfo.text = "There has been an error loading the requested information.";
}
}
// -------- </load vars> ------ \
And in frame 1 of about.swf I use this to call the text:
PHP Code:
_level0.myLV.load("vars/about.txt");
I've attached my FLAs and text file.
Click on "About" in the menu. See how that one text box appears (the one that's way out of place) yet nothing else appears? The working text box has the same instance name as the other, but the other is inside of the "boxmovie" movie clip. Ideas? Help would be much appreciated. I've been pounding my head against a wall for about 2 days now. I know there are workarounds, but I really just want to figure out how to get this to work. I need to load external text so that my client can edit the text files to change text (she doesn't own Flash). I think the problem might have to do with the code being read before the instance actually exists (because the code is in frame 1), but I've tried moving the code to frames 20 and 23, and it still doesn't work.
Thank you SO much for your help.
- Evan
Hi all,
I'm sorry if this is subject posted twice. I spent 20 minutes writing the original post, posted it (or so i thought) but it never apppeared. It's been an hour now, so I'm gonna post again. Here goes:
I have two swfs, a Master file and an About file. As swfs, the About file is loaded into the master swf through a movie clip loader. In the about file, I want to load external text into a text box. The problem is, when the text box is located INSIDE of a movie clip, it doesn't work. And I need it to work, because I want the text to load at certain point during the movie clip. To load the text, I use this code in frame 1 of master.swf:
PHP Code:
// -------- <load vars> ------ \
var myLV:LoadVars = new LoadVars();
myLV.onLoad = function (success:Boolean) {
if (success) {
_level5.loadedInfo.htmlText = myLV.info;
} else {
_level5.loadedInfo.text = "There has been an error loading the requested information.";
}
}
// -------- </load vars> ------ \
And in frame 1 of about.swf:
PHP Code:
_level0.myLV.load("vars/about.txt");
I have attached my FLAs and text file for you to sample. Click on "About" in the menu. See how that one text box appears (the one that's way out of place) yet nothing else appears? The working "dummy" text box has the same instance name as the other, but the other is inside of the "boxmovie" movie clip, while the dummy box is located on the About stage. Ideas? Help would be VERY much appreciated. I've been pounding my head against a wall for about 2 days now.
- Evan
<mod edit> Some posts get flagged for approval. Yours was one of them; and it's nothing personal. - gerbick (supermod)
Load External Text File (name Based On SWF Movie Name)
Hello,
I am trying to load external text based on the name of the SWF movie. I need to create several SWF files, which will each function as an independent quiz question. Instructors will edit the TXT files without having to work in Flash. If the SWF is named "1" I'd like it to load text dynamically from a text file named "1". This will save me from hard coding what text file will be loaded each time. There could be hundreds of questions total in the end. All of the files will need to exist in one directory.
I managed to trace the name of the SWF file using:
function getFileName(fileUrl) {
var fileName = fileUrl.substr(fileUrl.lastIndexOf("/")+1, fileUrl.length);
return unescape(fileName);
}
trace(this.getFileName(this._url));
Any ideas how I drop the ".SWF" extension and store this file name value as a variable? How can I tell flash to load [variable].txt instead of a known txt file?
Any help would be greatly appreciated. Thank you for your time.
How To Load Dynamic Text Inside A Movie Clip?
hello all - i have a main stage where on the first frame my "home" movie clip displays. i did this by dragging/dropping, and then i put a stop action. all works fine.
inside this home movie clip on the main stage, there are links to other movie clips. for example, to get to my faq's page - you click that button, then it takes you to frame 4 on my main stage, where my faq's movie clip (followed by stop action) has been dragged/dropped and displays properly.
within the faq's movie clip this process is repeated, with buttons taking to you various pages (different frames where different movie clips play - all works fine).
so now i want to add a dynamic text field within my faq's movie clip. i have read numerous tutorials where i have created the text file but i have not been able to display it with success within my faqs movie clip.
here is some code that my dvd tutorial instructs me to place on main stage as i practice getting this to work:
var myMCL:MovieClipLoader = new MovieClipLoader ();
var myListener:Object = new Object();
myMCL.addListener(myListener);
var myLV:LoadVars = new LoadVars();
myLV.onLoad = function (success:Boolean) {
if (success) {
_level5.loadedInfo.htmlText = myLV.info;
} else {
_level5.loadedInfo.text = "There has been an error loading the requested information. Please contact the webmaster.";
}
}
and here is some code that i place on the faqs button within my main movie clip that takes me back to main stage and plays faq movie clip all successfully:
on (release) {
//Movieclip GotoAndPlay Behavior
_root.gotoAndPlay("4");
//End Behavior
}
and finally, here is some code that i place within my faqs movie clip in an attempt to display my dynamic text within the faqs movie clip - so far unsuccessful:
_level0.myLV.load("vars/faqs.txt");
NOTE:
i have published this to view - not working.
i have my faqs text file starting as info=
i have eliminated white space within my text file
i am using flash 8 pro
can anyone offer some sugestions? thanks!
Loaded Movie Won't Load External Text File
Straight to the point:
I created a flash movie(news) with dynamic scrolling loaded text. It works perfect as a standalone. The problem is that when I load it from another movie(test) through a button event the movie loads but the text doesn't show. I,ve attached the fla files for the project. I used script from Actionscript.org for the scroller. Please if anyone has the time please look over the code and help me unravel the "loading mystery".
Loaded Movie Won't Load External Text File
Straight to the point:
I created a flash swf(scroller swf:news) with dynamic scrolling loaded text. It works perfect as a standalone. The problem is that when I load it from another swf(main swf:test) through a button event the movie loads but the text doesn't show. Please if anyone has the time please look over the code and help me unravel the "loading mystery". The tutorial i used for the dynamic scrolling text is found at Actionscript.org(Intermidiate tutorial 29).
Loaded Movie Won't Load External Text File
Straight to the point:
I created a flash movie(news) with dynamic scrolling loaded text. It works perfect as a standalone. The problem is that when I load it from another movie(test) through a button event the movie loads but the text doesn't show. I,ve attached the fla files for the project. I used script from Actionscript.org for the scroller. Please if anyone has the time please look over the code and help me unravel the "loading mystery".
|