To continu with our discussion…
Ref. yesterday.I would like to put a link inside a dynamic text (news.txt) to a frame label (special)???
My frame label (special) is on my timeline (13).
It’s my dynamic text (news.txt) that is loaded into my mc (news)
is why I have :
loadText = new loadVars();
loadText.load(“textes/news.txt”, “_root.news”);
I thank you in advance for your time or your file like.
I have a text file called corinneText.txt that contains
&label=special
Then in the Flash movie, which is located in the same folder as the text file, I have a first frame with some code in it and another frame later with the label special.
This is the code in the first frame:
stop();
/*** Preparation ***/
_root.createEmptyMovieClip("news",-1);
_root.createTextField("a",0,0,0,200,100 );
a.html=true;
/*** Loading ***/
loadText = new loadVars();
loadText.onLoad = function() {
a.htmlText = "<a href='asfunction:gotoAndStop,"+this.label+"'>Go to the frame Special</a>";
};
loadText.load("corinneText.txt", "_root.news");
The syntax is the following: asfunction:functionToCall,parameter(s).
Here you call gotoAndStop, with the parameter this.label that comes from your text file.
Cheers. Pom
I think this should be put in the Best of Kirupa, so could you please rate the thread?
Well, ASfunction is -was- undocumented AS, I think, but it should be in the last update of the AS dictionary.
Basically, when you put that in a link, it allows you to call a function when you click a link. You can of course define your own function that will do whatever you want, or call a predefined function like we did here. You can see the syntax in the example.
I’ll probably put that in the AS tricks some day [SIZE=1]when my exams are over… and when Kirupa updates his site…[/SIZE]
This is what I have done by fallowing your advice:
in my text file “corinneText.txt” I have:
sTextA =KP special
name of the film
a href=“special” More info /a
&label=special
in my flash movie I have on the timeline:
frame 1 : my movie Clip “news” with a instance name “news”
frame 13: a frame Label “special”
in my movieclip “news” I have on frame 1:
a dynamic text with the name “scroller” and a var name"sTextA"
and a scroller with a Target text field “scroller”
an action layer:
*Originally posted by corinne *
**in my text file “corinneText.txt” I have:
sTextA =KP special
name of the film
a href=“special” More info /a
&label=special
**
Is that what you have in your text file? Just like that? Because it won’t work that way. You have to separate your variables with &. Something like:
sTextE=KP special&name=name of the film&label=special
pom :asian:
well yes. but it work’s. I added only the tag for the fonts and the colors and the link for each text.
Because I call the var “sTextA” defined in my flash movie (dynamic text name) all my text are loaded.
Is it ok??
But the link that way is not working
a href=“special” (with the tag of course)
What is the correct link beside the &label=special ??
I don’t know how to thank you! You are such a good helper.
What would you advise :
I absolutly love flash, and want to keep progressing. What training would you advise to improve ?
Until know my knowledge come by trying stuff. As a graphic designer I develop my concept, I sell to my client and after I look for the “how I’m going to do that”.