Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Include File Question 1

Status
Not open for further replies.

saxy46

Technical User
May 19, 2005
9
0
0
US
I am not new to flash, but I have not used it in a while to build out a whole site. Now I have been asked to create a full site in flash but the user does not know flash and wanted to be able to update it without hassleing me.

Is there a way in flash that I could do an include file to an external file like maybe a straight html file or txt file that the person could update, and when flash opens, it will pull the information from the include file and display it on the page. Basically working the same way as a server side include.

If not, any ideas on what I can do to create a full site with maybe 8 sections in there but somehow make the content of those sections easily editable by someone flash illiterate?

Thanks for any suggestions or advise.
 
yea you can load text in from a a file on the webserver like this. The best method can be argued between XML or LoadVars();.

Here is the LoadVars(); method:

Create a a file on your computer (e.g. .php) with just &user=Whatever in it then save it and upload it to your webserver.

Then in flash in the actions panel on the timeline:
Code:
var lv = new LoadVars(); //create new loadvars obj var.
lv.onLoad = function(success){
    if(success){ //check for success
        //trace(this.varName);
        trace(this.user); //should display Whatever
        //you can load into a textbox if you wish
        _root.instanceName.text = this.user;
    }else{
        trace("Unable to load file");
    }
}
//load the file in
lv.sendAndLoad("path/to/file", lv, "GET");
hope it helps

Regards,

Martin

Computing Help And Info:
 
Thanks Martin!

After doing some searching, I did see this and how to do this. I tried it out and it looks like it will work for my purposes. I also saw that I could link a css file to it as well.

Thanks for the response!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top