-
Firmly Fastened to the Milk Sac of Misanthropy
Last night, I mentioned making a FK tutorial that shows how to customize a browsers right-click context menu and use it to navigate a SWF (IE5+/NS6). Well, the leg-work is done, and I would like you to try and break it (find bugs) before I send it to the FK Powers That Be. Thanks for helping me out! Also, do you think there is an interest for this sort of thing? (i.e. is it worth spending the time making the actual tutorial?)
Just for kicks, I merged my right-click script with Mr. Penner's ingenious Back button method (wanted to see if I could get it to work). I will leave the Back button out of the final tutorial (I'm going to email Robert Penner - if he gives me permission, and there is interest, I'll update the tutorial to include the Back button feature)
Anyway:
http://www.networksplus.net/sem/Back...ck/index2.html
Thanks to Nigs for making me consider javascript as a solution to the right click menu ('got me on the right track - replacing the context menu via js has been done before in an DHTML environment). Also, Xanth at Were-Here showed me how to make the menu via js.
Sem.
P.S. Excuse the cheesy, fake webpage with no preloader. Making something beautiful for testing purposes wasn't my goal - I wanted to keep er simple.
P.P.S Known bugs:
1. The right click menu may not work immediately. Give js a sec to kick in.
2. Pressing both mouse buttons simultaneously will sometimes bring up the standard browser context menu
3.It will intermittantly show the typical 'About Macromedia Flash 5' submenu rather than the custom menu. I haven't figured out why, it is pretty random (and very infrequent) -- any suggestions?
[Edited by Sem on 10-18-2001 at 04:50 AM]
-
It did take a very short time for the menu to pop up but it worked every time for me with minimal delay. I like it, it's a cheeky little effect you've got there I'm going to keep trying to break it though ![Stick Out Tongue](images/smilies/tongue.gif)
[Edited by jamble7000 on 10-18-2001 at 05:01 AM]
-
Firmly Fastened to the Milk Sac of Misanthropy
-
N' then I might just Jump back on An' ride Like a cowboy Into the dawn ........To Montana.
sem,
I went and had a play too and couldn't break it.
I look forward to taking a look once it is in the tutes section.
Are there FScommands from the dhtml layers back to the swf?
david p.
-
I get a JavaScript error on load (Line 11 Char 2, "Object doesn't support this property or method"), but if you click OK the menu still works fine. I'm using IE 5.50.4522.1800.
-
Firmly Fastened to the Milk Sac of Misanthropy
Originally posted by david petley
sem,
I went and had a play too and couldn't break it.
I look forward to taking a look once it is in the tutes section.
Are there FScommands from the dhtml layers back to the swf?
david p.
The div layers call a js function that passes a variable into Flash. Flash constantly looks for the variable to be updated via a clipEvent. There are really two variations to the trick. The first lacks the back button, while the second mutates penner's method so both the right click and back button share the same function. How it came about: After I finished the first method, I checked out penner's code and noticed the js function was almost identical, so I decided to make a hybrid (it's the Dr. Frankenstein in me ) With some tweaking, it came together. Thanks for helping me debug! ![Big Grin](images/smilies/biggrin.gif)
Sem.
...
[Edited by Sem on 10-18-2001 at 05:43 AM]
-
Originally posted by Sem
Originally posted by jamble7000
It did take a very time for the menu to pop up but it worked every time for me with minimal delay. I like it, it's a cheeky little effect you've got there I'm going to keep trying to break it though
Thanks for the feedback Could you help me out - How long did it take to pop up? Was the delay happen on only the initial right-click, or was there a delay every time? Also, what browser and type of computer are you using?
Thanks for the help,
Sem.
The delay was literally a split second, it was a noticable delay but only because it wasn't instant like the normal right click.
-
Firmly Fastened to the Milk Sac of Misanthropy
[QUOTE]Originally posted by jamble7000
The delay was literally a split second, it was a noticable delay but only because it wasn't instant like the normal right click.
Hmm, a javascript limitation, you think?
-
[QUOTE]Originally posted by Sem
Originally posted by jamble7000
The delay was literally a split second, it was a noticable delay but only because it wasn't instant like the normal right click.
Hmm, a javascript limitation, you think?
Could be I guess...my knowledge of js is limited to say the most I would imagine it's only because the file/script isn't as a default setting or integral part of the browser set up so it will still have to load. I certainly wouldn't say it's a problem with the menu though, it's fine as it is.
-
Firmly Fastened to the Milk Sac of Misanthropy
[QUOTE]Originally posted by jamble7000
Originally posted by Sem
Originally posted by jamble7000
The delay was literally a split second, it was a noticable delay but only because it wasn't instant like the normal right click.
Hmm, a javascript limitation, you think?
Could be I guess...my knowledge of js is limited to say the most ![Stick Out Tongue](images/smilies/tongue.gif) I would imagine it's only because the file/script isn't as a default setting or integral part of the browser set up so it will still have to load. I certainly wouldn't say it's a problem with the menu though, it's fine as it is.
Cool, I'm glad it works. I don't want to come off as a js expert. The scripts I used are known techniques - the DHTML context menu (this style script was given to me by a guy named Xanth on Were-Here, but I found variations on a few different DHTML resource sites), and passing variables to flash directly from javascript (found on Macromedia tech-notes). I just applied them. Still learning... I plan on providing links to all the sites I used during my research - maybe someone can make this better, or put a new twist on it (and hopefully frustrate Jakob Nielson in the process!). The variations for it's use in a swf are not limited to just navigation - the developer can use the passed variable for anything they need.
Sem.
[Edited by Sem on 10-18-2001 at 05:50 AM]
-
Nice effect,
It works fine with me, no delays etc. using IE 5.5 and 6
-
So does nobody care that I get a Javascript error? Ah well, I suppose by now I should've got used to being ignored...
-
N' then I might just Jump back on An' ride Like a cowboy Into the dawn ........To Montana.
Originally posted by Stickman
So does nobody care that I get a Javascript error? Ah well, I suppose by now I should've got used to being ignored...
aw, Stickman, I care.![Smilie](images/smilies/smile.gif)
david p.
-
Firmly Fastened to the Milk Sac of Misanthropy
Originally posted by Stickman
So does nobody care that I get a Javascript error? Ah well, I suppose by now I should've got used to being ignored...
Stickman,
I'm poring over the script trying to find the flaw - just haven't got it yet. Thanks for the feedback ![Big Grin](images/smilies/biggrin.gif)
Sem.
-
by David Petley
aw, Stickman, I care.
*Sniff* thanks...I feel better now.
-
Sem: The problem seems to be in 'Blah Designs - Main.html', when it tries to call the function setpage() in the parent document.
Code:
parent.flashframe.setPage(1);
I wonder if it's a timing issue -- the other frame hasn't loaded properly when you try to call the function, so it doesn't recognise the function?
-
Former Employee of Satan
I also get the same Javascript error Stickman gets. If I chose not to debug it closes IE (5.00) completely.
-
Under the influence
I am actually quite surprised noone has figured it out yet.
Ok, the problem with the right click and then the flash menu comin up isnt random at all. It depends whether your mouse is hovering over a bit of text, imagery or otherwise. for example: the grey lines on the bottom are somehow linked with the rest of the mc's so that when you right click on them, the default menu comes up. However, the black background of the movie seems unaffected. This means you might have to apply this script to each and every mc on the fla????? maybe???
I hope this helps. If you dont understand me, let me know.
-
bvgroote is right about the menu pop-up problem.
This means you might have to apply this script to each and every mc on the fla????? maybe???
It won't work, because Flash can't trap for right-click. I suspect it's only working at all because the background of the .swf is transparent -- so you're effectively clicking on the HTML (which can trap for right-click), not the Flash (which can't).
The more I look into the JavaScript error the more I'm convinced it's a timing issue. Perhaps you need to create some sort of check to make sure the main flash document is loaded before trying to execute the setpage() script.
-
Firmly Fastened to the Milk Sac of Misanthropy
Brilliant suggestions, I'll fix it up. Anyone else having problems with it?
Sem.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|