Dynamic text used to trigger a movie?!?

Hello…

Im wondering how to take specific words in a dynamic text box and use them to trigger a movie inside of flash. It seems like it would be simple but i cant figure out how to turn just a few words inside of one bigger text box into … well… almost buttons…

What i would like to happen is… one box has a list of dates or words… these are almost like hyperlinks i guess… when they are clicked… it triggers a movie though, instead of a URL.

does anybody understand what im trying to do? and if so… can somebody explain how to do it?

thanx

Nope. You can just add in hyperlinks for URL’s in loaded text.

It’s basically the same thing… :stuck_out_tongue:

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=32542

Holy buckets - I’m sorry, I retract my ‘nope’, you can. Wow. Sorry!

thats a step closer in the right direction i guess… but not really what i was looking to accomplish… thank you though…

Close? What are you trying to do exactly?

…The asfunction protocol is pretty much the only way, I think. :-\

ok… in my flash movie there are TWO boxes that are used to contain data. One is used to list archived sections, dates, events, ect. BAsicly just a list of whatever. Being that the list can be somewhat long depending on the section, ive use dynamic text box for this that way i could add a scroller. … Now… the situation at hand… is that i would like ONE specific date/title within that box to trigger the data in the other box to load on release.

Basicly you have a box full of hyperlink on one side of the site… that triggers data to load on the other side of site… …

ITs for a band… so the best example i can give is this:

BOX ONE (LEFT) contains song names.
BOX TWO (RIGHT) will contain LYRICS to each one of those songs.

By clicking each song name, i would like it to trigger a different movie instance or graphic instance of the lyrics, that pertains to that song name.

The code in the tut up above, changes the entire dynamic box into a link… where as i need each individial line in the box to be a link.

thanx

That’s not true, you could have as many links as you wish.
[AS]myTextField.htmlText = “<a href=‘asfunction:function,arguments’>one link here</a> some text here <a href='asfunction:function,arguments’>another link here</a>”;[/AS]
Get the point? :wink:

ahhh… gotcha… didnt even think of that… good call…

now… instead of triggering frames… is there a way to trigger movie instances or graphic instances…

and if i use a bunch … will it still scroll up and down with the scroller?

You could set up a function to do all those things you want.
[AS]myFunction = function() {
myClip.loadMovie(“someMovie.swf”);
myOtherClip.gotoAndStop(“Xframe”);
myClip.myChildClip.removeMovieClip();
// etc, etc, etc.
};
myTextField.htmlText = “<a href=‘asfunction:myFunction’>do your stuff</a>”;[/AS]
[EDIT]http://www.macromedia.com/support/flash/ts/documents/asfunction.htm[/EDIT]

that should work… thank you very much…

You’re welcome. :beam:

And I forgot to add something…

Although there’s a workaround to pass multiple parameters to the function in the TechNote (see link in the post above), this is what I usually use:
[AS]// define function myFunction
myFunction = function (arg1, arg2, arg3) {
// if there’s only one argument
if (arguments.length == 1) {
// create arguments array
var args = arg1.split(",");
// execute the function
arguments.callee.apply(this, args);
// stop the function
return;
}
trace("The first parameter is: "+arg1);
trace("The second parameter is: "+arg2);
trace("The third parameter is: "+arg3);
};[/AS]

either way… its over my head… so im going to have to take some time and trial and error runs to figure it out anyway… i should be able to figure it out eventually though… thank you

Ok… good luck! And let me know if you have any question. :wink:

If you wanted to use asFunction() with xml would you be allowed to? or would flash want to parse the <a></a> as a childNode?

Anyone know about this? Or a work around for it?

Yes, can use it. You shouldn’t have any problems. :slight_smile: