PDA

View Full Version : links in dynamic text to control a movie



jayrich86
November 13th, 2006, 12:23 PM
Is it possible to have dynamic loading text, from a textfile, being rendered as HTML, that will send information to flash to play a certain frame?

what im trying to do is create some sort of dynamic scrollable menu, that contains links that are editable from a text file. these links will then direct flash to a certain frame in the timeline.

i.e. in the text box you scroll and click "frame102" and then flash skips to frame 102...
please help me!

jayrich86
November 13th, 2006, 12:24 PM
or is it possible to have these links, change the value of a variable?
i.e. you click the link from the textbox in flash, and it changes the value of some variable to 10?

scotty
November 14th, 2006, 10:39 AM
Have a look for asfunction
http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001719.html

scotty(-:

eslacker
November 14th, 2006, 11:17 AM
Yep, asfunction is what you want. You'll need to then create a separate function that you pass the frame number you want to jump to. Your code will look something like:

[html code]
<a href="asfunction:funcName,100">jump ahead</a>
[/html code]

asfunction basically takes the function name and args separated by commas (no spaces in between). So, in your function, you may need to split out the args if you're passing more than one value (say a next frame number and a previous frame number).

funcName(args){
var aArgs = []
aArgs = args.split(","); //Specify the char used as a delimiter

//do stuff
for(var i=0;i<aArgs.length;i++){
trace(aArgs[i]);
}
}

jayrich86
November 30th, 2006, 01:04 PM
Yep, asfunction is what you want. You'll need to then create a separate function that you pass the frame number you want to jump to. Your code will look something like:

[html code]
<a href="asfunction:funcName,100">jump ahead</a>
[/html code]

asfunction basically takes the function name and args separated by commas (no spaces in between). So, in your function, you may need to split out the args if you're passing more than one value (say a next frame number and a previous frame number).

funcName(args){
var aArgs = []
aArgs = args.split(","); //Specify the char used as a delimiter

//do stuff
for(var i=0;i<aArgs.length;i++){
trace(aArgs[i]);
}
}

thanks this is pretty much what im trying to do! however i am a noob to flash, so if you could maybe help me out more specifically that would be awesome.

heres what im trying to do,
1. when the link is clicked, it sets a variable i.e. _global.gallery = "people"; then it goes to a frame and plays. i kind of understand the code you left me, i guess i would have to put it as setgallery, "people" ? please let me know thanks!