PDA

View Full Version : shake browser window....



daveg92656
September 25th, 2003, 07:13 PM
Hi all,

Newbie here using FlashMX. Hopefully someone can shed some light for me. I have an "infoMC" within my main .swf which holds the text info and graphics for each subsection of my site.

At one point, I have two doors slamming shut and I want to use the shake browser javascript function when they close together.

I originally saw the tutorial on www.flashkit.com, by Mark Fennell, who describes the function well. I used the code he provided, placed this in my html file generated by Flash and on a button or link, it works fine.

If using a button, I am able to do this without a problem, however, when I use a frame action and use the "get URL (javascript:shake_xy(3);"); it does not work. I have searched many flash tutorial sites and cannot find anything which helps me.

Does anyone have any ideas on how to shake the browser window from within Flash?? I assume I use the same js code within my html file? Do I need an "enterFrame" action or will "Get URL" be enough?

thanks for your help!! dave.

kode
September 25th, 2003, 07:24 PM
...Try this one: http://proto.layer51.com/d.aspx?f=278.

claudio
September 25th, 2003, 07:24 PM
getURL("javascript:shake_xy(3)");

kode
September 25th, 2003, 07:27 PM
Isn't that the same code he posted, claudio? :-\

claudio
September 25th, 2003, 07:45 PM
Nope, theres an extra ; on his code

kode
September 25th, 2003, 07:52 PM
Ehmm... that semicolon makes no difference. :P

claudio
September 25th, 2003, 07:56 PM
Well, in that case, the script should work :-\

kode
September 25th, 2003, 08:15 PM
Now that I read his post again...

He referred to the getURL action as get URL, the space between get and URL is probably the problem. Unless he only posted it like that in his post, and there's no space in the actual code.

claudio
September 25th, 2003, 08:17 PM
Ops, ive noticed and corrected that, but forgot to mention :blush:

kode
September 25th, 2003, 08:21 PM
Sure, claudio... sure.


















Hehe - I'm kidding. ;)

claudio
September 25th, 2003, 08:24 PM
Right Kax, you genius:P

daveg92656
September 25th, 2003, 09:16 PM
Hi Kode and Claudio,

thanks for your input, I will try that link Kode. I know that particular link was referrenced elsewhere, but the link was dead. that one you provided works and I will try the code listed there.

And yes, I know that there is no space b/w "get" and "URL", and I have tried with and without the 2nd semi-colon also. But thank you for both bits of info, because many times a programming language, will not work or compile because of a missing or mis-placed semi-colon or quote or something....

So thanks to both for responding, I will try the new code and let you know if it works....thanks again! Dave

claudio
September 25th, 2003, 09:19 PM
I just tested and it works ;)