all groups > flash actionscript > april 2006 >
You're in the

flash actionscript

group:

trying again: getURL issue


trying again: getURL issue hsheffer
4/9/2006 10:03:53 PM
flash actionscript:
I'm trying to make a boton linked to an HTML file, (that contains swf), and I
want to skeep the first swf frame, and start playing in second frame.
normaly i'd use

on (release) {
getURL("projects.html", "_self");
}

what should I do in this case?
thanks!
Re: trying again: getURL issue Star Tail Pro
4/9/2006 10:34:06 PM
Re: trying again: getURL issue hsheffer
4/9/2006 10:56:41 PM
Re: trying again: getURL issue abeall
4/10/2006 12:29:33 AM
[quoted text, click to view]
The short answer is you cannot do that with HTML.

However, there are ways to do it. One way is to use FlashVars(look it up) in
the embed tags. You would make your FlashVar something like:
FlashVars="goto="
And then you use a serverside scripting language, such as PHP, to take a
getString like "projects.php?goto=2" and replaces in your document with 2, so
the FlashVar becomes:
FlashVars="goto=2"
and then in Flash movie you use a script on frame 1:
_root.gotoAndPlay(goto);

Another alternative that doesn't require any serverside scripting might be to
use the SharedObject(look it up). You could make your button first save a flash
cookie "goto" and then on frame 1 you load the Flash Cookie and
gotoAndPlay(mySharedObject.data.goto)...
Re: trying again: getURL issue abeall
4/10/2006 12:39:02 AM
http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=288&thre
adid=1140873


http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=288&thre
adid=1140935


http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=288&thre
adid=1140876

You really need to stop posting duplicate posts. It's very bad etiquette.
User's might try and help you in one thread not realizing that your question
has already been answered in another, and user's in one thread will give you
answers without the knowledge of what's already been discussed in other
threads. You are wasting helpful user's valuable time to post so many duplicate
posts, it's not a small deal.
Re: trying again: getURL issue hsheffer
4/10/2006 4:56:30 PM
well
I'm not an expert in actionscript, and couldn't figure out the complicated
suggestions that I got. sorry...
isn't there any simple "normal mode". some script that I can choose, to link
strait to the second frame of the swf file? or any script that I can copy paste
easy like in gotoAndPlay. somthing like:

on (release) {
getURL("projects.html, 2");
}

(thay in not working of course)
is it an uncommon action?
desperate...




Re: trying again: getURL issue abeall
4/10/2006 5:08:15 PM
Re: trying again: getURL issue hsheffer
4/10/2006 5:11:40 PM
yes, but I cant find there what i need - getURL to the second frame of the swf movie - skip the first frame.
do you know a simle script for that?
Re: trying again: getURL issue abeall
4/10/2006 5:36:04 PM
Re: trying again: getURL issue artfabrique
4/10/2006 5:36:22 PM
simply, you cann't do it simple :-)

you cann't control movie in one window from another movie in another browser
window just with ActionScript.

you must use some stuff like Javascript or if it will be always second frame
(not dynamic) you can script in in html file you've opened whith getUrl().

for example:
you have 2 files - index.html(with movie1.swf) and picture.html (with
movie2.swf)
in picture.html there is the clip you want to control from index.html.
so open picture.html whith editor and find all "movie2.swf" strings and
replace'em to "movie2.swf?fr=2"
it is the simple way to set variables in flash (but not so good)

and in the movie2 first frame in the root write this script:

if(fr!="") {
goToAndPlay(fr);
}

that shoul work =)
Re: trying again: getURL issue artfabrique
4/10/2006 5:38:40 PM
OH! i forgot
in movie1 just syply use getURL("picture.html", "_self");
Re: trying again: getURL issue hsheffer
4/10/2006 6:06:37 PM
the answer is cleer (i belive), but thats good only if I want always to star
with 2 frame isn't it?
is there a way to skip first frame only if i link from index.html (in your
example) and all other enters to start from first frame.
thanks
AddThis Social Bookmark Button