A Flash Developer Resource Site

Page 1 of 4 1234 LastLast
Results 1 to 20 of 64

Thread: My right click menu FK tute is finally done. Would you try to break it for me?

  1. #1
    Firmly Fastened to the Milk Sac of Misanthropy
    Join Date
    Aug 2000
    Posts
    463
    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]

  2. #2
    Señor member
    Join Date
    Dec 2000
    Location
    Huddersfield, UK
    Posts
    1,819
    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
    [Edited by jamble7000 on 10-18-2001 at 05:01 AM]

  3. #3
    Firmly Fastened to the Milk Sac of Misanthropy
    Join Date
    Aug 2000
    Posts
    463
    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.

  4. #4
    N' then I might just
    Jump back on
    An' ride
    Like a cowboy
    Into the dawn
    ........To Montana.
    david petley's Avatar
    Join Date
    Jun 2000
    Location
    not in Montana ™
    Posts
    10,192
    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.

  5. #5
    Senior Member
    Join Date
    Jul 2000
    Location
    Not on the dole any more
    Posts
    1,040
    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.

  6. #6
    Firmly Fastened to the Milk Sac of Misanthropy
    Join Date
    Aug 2000
    Posts
    463
    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!

    Sem.

    ...
    [Edited by Sem on 10-18-2001 at 05:43 AM]

  7. #7
    Señor member
    Join Date
    Dec 2000
    Location
    Huddersfield, UK
    Posts
    1,819
    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.

  8. #8
    Firmly Fastened to the Milk Sac of Misanthropy
    Join Date
    Aug 2000
    Posts
    463
    [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?

  9. #9
    Señor member
    Join Date
    Dec 2000
    Location
    Huddersfield, UK
    Posts
    1,819
    [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.

  10. #10
    Firmly Fastened to the Milk Sac of Misanthropy
    Join Date
    Aug 2000
    Posts
    463
    [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 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]

  11. #11
    FlashKit Joker
    Join Date
    Jan 2001
    Posts
    659
    Nice effect,

    It works fine with me, no delays etc. using IE 5.5 and 6

  12. #12
    Senior Member
    Join Date
    Jul 2000
    Location
    Not on the dole any more
    Posts
    1,040
    So does nobody care that I get a Javascript error? Ah well, I suppose by now I should've got used to being ignored...

  13. #13
    N' then I might just
    Jump back on
    An' ride
    Like a cowboy
    Into the dawn
    ........To Montana.
    david petley's Avatar
    Join Date
    Jun 2000
    Location
    not in Montana ™
    Posts
    10,192
    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.
    david p.

  14. #14
    Firmly Fastened to the Milk Sac of Misanthropy
    Join Date
    Aug 2000
    Posts
    463
    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

    Sem.

  15. #15
    Senior Member
    Join Date
    Jul 2000
    Location
    Not on the dole any more
    Posts
    1,040
    by David Petley
    aw, Stickman, I care.
    *Sniff* thanks...I feel better now.

  16. #16
    Senior Member
    Join Date
    Jul 2000
    Location
    Not on the dole any more
    Posts
    1,040
    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?

  17. #17
    Former Employee of Satan Napalm's Avatar
    Join Date
    May 2000
    Location
    Stellenbosch, South Africa
    Posts
    561
    I also get the same Javascript error Stickman gets. If I chose not to debug it closes IE (5.00) completely.

  18. #18
    Under the influence bvgroote's Avatar
    Join Date
    Nov 2000
    Location
    Perth, Australia
    Posts
    1,408
    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.

  19. #19
    Senior Member
    Join Date
    Jul 2000
    Location
    Not on the dole any more
    Posts
    1,040
    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.

  20. #20
    Firmly Fastened to the Milk Sac of Misanthropy
    Join Date
    Aug 2000
    Posts
    463
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center