Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
| Subject: | RE: FLASH: load variables - links |
| From: | Paul Willoughby |
| Date: | Wed, 22 Nov 2000 12:09:34 GMT |
Hi -J,
With HTML having a bit of support in Flash 5 it's pretty easy to load
links stored in a separate HTML file. It's all documented in the
Macromedia tech notes. See esp.
http://www.macromedia.com/support/flash/ts/documents/htmltext.htm .
Flash 5 supports the HREF tag so links would work just like a normal
HTML page.
If your using Flash 4, or you don't want to use HTML for some reason,
you can load the links as variables in a text file. These variables are
little x=y pairs joined together with ampersands. A text file with a few
URL's (2 absolute, 2 relative) as variables might look like this...
URL1=http://www.macromedia.com&URL2=http://www.flashkit.com&URL3=nextDir
ectoryDown/anotherPage.html&URL4=../oneLevelUp.html
...which looks a lot clearer like this (but it doesn't work unless
everything is on one line without spaces)...
URL1=http://www.macromedia.com
&
URL2=http://www.flashkit.com
&
URL3=nextDirectoryDown/anotherPage.html
&
URL4=../oneLevelUp.html
So make your text file, then add a load movie action to the first frame
of your movie and choose the option to load variables. Choose to load
them in to level0 or a target movie clip that contains your menu. Make
sure the text file is in the same directory as the SWF and type its name
in the URL field: yourVariableFile.txt . Result is this:
Load Variables ("yourVariableFile.txt", 0)
If you load them into level0 the variables can be targeted from anywhere
in the movie by preceding them with '/:' (no quotes) as in my example.
On your link buttons (note: this will only work with buttons, unlike the
HTML method) you can then specify the URL in the GetURL action as a
variable:
On (Release)
Get URL (/:URL1)
End On
Make sure that the URL field is set to expression, *not* a string.
If you've got a lot of links you might want to make sure the text file
is loaded by adding an EOF=true variable at the end of your text file.
You can then run a 2 frame loop that checks for this variable before
continuing.
I reckon this is a great way to manage the links on your site as you
never have to touch the .fla or SWF unless you want completely new menu
items. Even then, you could set up a routine to generate an amount of
menu buttons that matches the amount of URL's quite easily, without even
touching something like Generator.
On the other hand, writing these text files isn't particularly user
friendly for non-technical staff. To make it easier you could write a
macro in Excel to convert a table into a text file or sumink like that.
hope this helps
paul
Jason wrote on 21 November 2000
> I want to point some links in a swf to read from an
> external text document. Not dynamically generated,
> just some static links that can be changed in the text
> document without having to go into the Fla file.
>
> I know this can be done in the Load Movie dialog box,
> but am having trouble.
>
> -J
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
November 27-29, 2000, LONDON, National Film Theatre
Produced by United Digital Artists and lynda.com
-Sponsored by Macromedia, Adobe Systems and Apple Computer
-http://www.flashforward2000.com or UK tel. +44 (0870) 751 1526
Register before November 10 and save �200
http:// www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email help
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]

