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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xml and flash

Status
Not open for further replies.

blended

Programmer
Aug 8, 2000
154
US
This is conceivably a pretty simple question, because I've figured out most of the hard parts. Here goes. I've built an xml page to load into a movie target with text variables. For example, text variable 1 is called "title", 2 is "body" and so on. In the xml page, I refer to an external text file where the text says: "title=lah de dah de dah" (no quotes) and it works fine. But if I add a second variable in the same text file (i.e., "body=this is the body of the title") then it loads it into the title part. It makes sense why it does this, but is there some kind of code to put at the end of desired text and before another variable? I want to be able to update only one text file, not an endless series of text files to achive one goal. Anyone who can help with this will be thanked endlessly.

Thanks,

Blended
 
Haven't I seen you around somewhere?

This from the Help Files might answer your question:

When you use the loadVariables, getURL, or loadMovie actions, you can specify several arguments:

URL is the file in which the remote variables reside.
Location is the level or target in the movie that receives the variables.
For more information about levels and targets, see About multiple Timelines.
Note: The getURL action does not take this argument.
Variables sets the HTTP method, either GET or POST, by which the variables will be sent.

For example, if you wanted to track the high scores for a game, you could store the scores on a server and use a loadVariables action to load them into the movie each time someone played the game. The action might look something like this:

loadVariables(" _root.scoreClip, GET);
This loads variables from the PHP script called high_score.php into the movie clip instance scoreClip using the GET HTTP method.

Any variables loaded with the loadVariables action must be in the standard MIME format application/x- (a standard format used by CGI scripts). The file that you specify in the URL argument of the loadVariables action must write out the variable and value pairs in this format so that Flash can read them.


The file can specify any number of variables; variable and value pairs must be separated with an ampersand (&) and words within a value must be separated with a plus (+). For example, this phrase defines several variables:

highScore1=54000&playerName1=rockin+good&highScore2=53455&playerName2=bonehelmet&highScore3=42885&playerName3=soda+pop
For more information on loadVariables, getURL, and loadMovie, see their entries in the ActionScript Dictionary.


... If it doesn't... Well I tried!

X-)




"Just when you're going to have ends meet...
Somebody changes the ends!"
 
Wow, thanks so much. I scoured the help files AGAIN this morning and couldn't find any of this stuff. This seems like it should do the trick, if it doesn't, well, I guess i'm off to another amazing work-around. Thanks so much for the help!

Blended

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top