-
textfield loads into .swf but not when loaded into main movie?
I'm loading a textfile into a textfield, this works fine locally but when I upload to the site the textfield remains empty? Heres my code: -
code:
loadVarsText = new loadVars();
loadVarsText.load("mytextfile.txt");
loadVarsText.onLoad = function (success){
if (success){
textfield.text = this.mytext;
}else{
textfield.text = "not loaded";
}
}
it doesn't even display the text "not loaded".
Any help appreciated, cheers
Last edited by danthomas; 03-16-2004 at 01:12 PM.
-
check the path of "mytextfile.txt"
also, did you upload "mytextfile.txt" to your server?
-
Thanks but I think I'm just about getting to the root of the problem. Everything was fine(ish) apart from trying to load dynamic text into a loaded swf whereby the main movie uses a mask!!???!!!?!??!
Aparently this can't be done unless using pixelfonts or loading the swf above the mask layer on the main movie.
Anyone else come across this? Weird or what, I do love spending hours finding out the most random errors!
Dan
-
Between Flash & Flashkit
Code:
textfield.embedFonts=true;
if its masked ,embed it ..then NP
I want to learn .
wannabe flasher [ Actionscript 2.0 ]
-
Didn't work and I have found out its nothing to do with the mask, completely deleted the mask from main movie and still same prob, have tried embedding font (thru code and at design time) to no avail either.
heres loaded swf
which works fine (loads the text into textbox at top right)
and heres the main movie
click on Joe Writes, which loads the swf into level 2 and doesn't work at all. All the files are in the same directory and definately there, same happens locally and remotely.
here is the exact code if anyone can see what is wrong u go straight to the top of my xmas card list: -
code:
// on 'joe writes' button in main movie
on (release) {
unloadMovieNum(2);
loadMovieNum("joewords.swf", 2);
}
// on first frame of loaded swf
loadVarsText = new LoadVars();
loadVarsText.load("book_ttv.txt");
loadVarsText.onLoad = function(success) {
if (success) {
scroller.text = this.mytext;
// just some extra traces; delete afterwards
trace("this.mytext = " + this.mytext)
trace("scroller = " + scroller)
trace("scroller.text = " + scroller.text)
// scroller = instancename of textfield on the same timeline as this LoadVars object
} else {
trace("not loaded");
}
};
Resetscroll()
function ResetScroll(){ //Reset ScrollBar
bookscroll.setScrollTarget(scroller);
bookscroll.setScrollPosition(0);
}
stop();
-
Between Flash & Flashkit
Code:
if (success) {
scroller.text = this.book_ttv;
try that ..let me know
I want to learn .
wannabe flasher [ Actionscript 2.0 ]
-
no joy i'm afraid
-
Between Flash & Flashkit
is this a different dynamic txtifeld form your other 1 .. make sure its html rendered..
in the properties inspeector ..
also post the fla ..please
I want to learn .
wannabe flasher [ Actionscript 2.0 ]
-
What's this bit for?
Resetscroll()
function ResetScroll(){ //Reset ScrollBar
bookscroll.setScrollTarget(scroller);
bookscroll.setScrollPosition(0);
}
stop();
It works for me loading it in another movie...
http://blake.prohosting.com/~tektips/joemain.swf
on (release) {
loadMovieNum("joewords.swf", 2);
}
-
That resets the scrollbar to the top and to the right size when different textfiles are loaded (for the other books - buttons down the middle) which again all load fine when directly looking at the swf but not when loaded in my main movie.
Its a site i've inherited so will have a good look through the main movie to see if there's anything there that could be affecting this.
But what could possibly cause it to not work? I've tried loading the textfiles into simple movies (the same as oldnewbie) and it works fine (so textfile should be ok), renaming the variables (so no conflicts), setting the variables to the _root (so no pathing probs), removing all masks (so no masky bugs), embedding fonts... etc etc!
Fortunately i've only resulted to chewing through the desk a couple of times so patience is bearing up well! I'll have another look tonight and if I can't solve it i'll post the fla.
Really appreciate the help guys,
Dan
-
Between Flash & Flashkit
good luck .. post it !!!
cheers
I want to learn .
wannabe flasher [ Actionscript 2.0 ]
-
AAAAARrrrrrrrrrrrrrgggggggggghhhhhhhhhh!!!!!!!!!
Time of first post = 12:03pm (and that was after an hour of searching)
Time now = 6:53pm
What the fool did wrong (long version) = several hours ago (pre-problem) I changed the publish settings of the loaded swf to flash 6 instead of 5 (to accomodate the newly added scroll bar - thats all I was trying to do!) This allowed me to use a scrollbar but I needed to change from old 'loadVariables' method to 'loadVars' in order to reset the scrollbar for different textfiles, which all worked fine on the loaded swf. Its just taken me best part of a day to realise I should have changed the publish settings of the main movie to flash 6 as well in order for it all to work in the main movie... Doh!
What the fool did wrong (short version) = got up this morning.
Thanks again guys, I'm off to sit in the corner and hang my head in shame!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|