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

loading external txt with links to .swf files

Status
Not open for further replies.

goodtoe

Technical User
Mar 26, 2003
7
US
i am loading a external text file with html links. I would like to know if anyone out there know how to make those links load .swf files, that would work with the levels hierarchy of the original level0 file. I tried passing a variable that would be detected by a movie clip on EnterFrame but no success, maybe I had written something wrong. Loading just the swf file will replace the html page on the browser.
 
you can use asfunction to get this effect
in the text file make the links like this

<a href='asfunction:loadthis,main'><u>Main SWF File</u></a>

then in flash on the main timeline

function loadthis(file){
movie = file + &quot;.swf&quot;;
loadmovie(movie,holder);
}

where holder is the instance name of an empty movie clip on stage.
 
i will try that. i let you know in a sec how it worked. thanks anyway.
 
bill, what does main in 'asfunction:loadthis,main' stands for? and the load this is just a function to load 'main'?
 
loadthis is the name of the function in flash
main is the variable to be passed
clear as mud ??
 
so far so good. but then in flash, which ones of these lines i will have to modify?
function loadthis(file){
movie = file + &quot;.swf&quot;;
loadmovie(movie,holder);
}

the name of my file is teste.swf and the holder will be 'this'

other question, can i run that script on onclipEvent (enterFrame)?
 
teste instead of main in the text file and this instead of holder in the function

i dont like using a reserved word (this) as a movie clip instance name. that may cause problems.

not sure what you mean by using on enterframe. the function will be triggered by a click in the text file.
 
so the function on the main timeline could be on the first frame?
 
could be..no reason why not...but if the textfield is nestled inside a movie clip then you will have to target the loadthis function from the text file with something like

_root.clip.loadthis,teste' etc

 
yo bill,
thanks a lot. it makes sense. but my limitations are stopping it from working i guess. I am still having a hard time figuring out what do i have to change to make it work for me. The name of the file i will launch will be portfolio01.swf

on the text file i have:
<a href='asfunction:loadthis,main'><font color=333333>View</font></a>

on the first frame:
function loadthis(file){
movie = file + &quot;.swf&quot;;
loadmovie(movie,holder);
}

Not wanting to be a pain in the rear, but already being,
 
change main to portfolio01 and make sure the clip is called holder

if you still dont have it ill make you a small fla and post it
 
you kick ass. thanks a lot. owe yo big time
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top