Now, I have several buttons, which I have given the instance names of:
home
about
projects
links
contact
These buttons are in a movie clip within the movie clip that contains the dynamic textbox.
I would like for the textbox (instance name: info) to load a new .txt file when the relevant button is released.
Example: I release the “contact” button. The textbox (info) loads the .txt file jk87contact.txt because that is what has been specified for it to load when the contact button is released.
I have tried the following code (again, in the actions layer, following on from the previous AS code) :
[AS]_root.contact.onRelease = function(){
loadText2 = new loadVars ();
loadText2.load(“jk87contact.txt”);
}[/AS]
But when I release the button, no result. Nothing changes. And here is what I put in the jk87contact.txt file:
“jkinfo=Tralalalla lalala lallallllalaaa…!!”
Just in-case you thought I forgot to put “jkinfo=” :).
Well, kax is officially the supreme being today. The example I gave above was a simplified version of what I am using so I created a simplified .fla to just test it out, and it works perfectly. Thanks so much!!! :beam:.
How might I go about setting a default .txt file which loads when the .swf first runs? (i.e. before the user selects a button to go to load a certain .txt file).
Here’s the more complex problem (which I have failed to fix). I have tried to simplify it by placing the necessary movie clips from the different .swf files into one (in the vain hope that it would solve the problem).
My buttons are in a movieclip with the instance name “menu”. My dynamic textboxes are in a movieclip with the instance name"webstart". I need to get them to work together so that when a button is clicked, it follows it’s code and gets the “info” textbox to load the relevant .txt file.
I can’t seem to get it to work (I guess because I’m rather weak on the structure of Flash when you use multiple layers and then movie clips and layers within those movie clips etc.), is there any chance you could explain how to solve it pretty pretty please? puppy dog eyes
It might be that I’m placing the code in the wrong places but I think it’s more likely that in order for them to work together, I have to use certain prefixes… (like _root and _parent)
Sorry for dragging this on but I have spent the good part of three hours (overall) trying to get this darn thing to work :-/.
Well, I have most of it working - all the actionscript is in the main timeline and working fine except for the buttons :-… I think it’s big problem is that the function is defined in the main timeline but the buttons are in one movieclip and then the dynamic textbox is in another movieclip.
No luck so far. I will give it another go sometime tonight or tomorrow and I’ll make sure to let you know when I figure it out :).