Jump to content
Search Community

VideoLoader & custom rmb menu

failure13 test
Moderator Tag

Recommended Posts

So i got my VideoLoader, and i've build custom right mouse button menu with some link...

Strangely enough, it works if you click rmb and then clcik on the link somewhere on the content, but if you click on this link on video itself (.rawContent) - nothing happens :\

Probably some security issues, any thoughts? :)

Link to comment
Share on other sites

  • 3 weeks later...

Sorry this question hasn't been answered. Not so sure what the question is as I'm not so sure what a link is or how it is being applied. Are you referring to links like in HTML or some sort of mouse action in general? Is your problem specific to using the right mouse button? If you are trying to do something on the rawContent of the video and its not working have you tried using the content?

 

please elaborate or post a very simple fla that we can use to easily diagnose the issue.

 

thanks

Link to comment
Share on other sites

Oh, i didn't knew that you haven't understood the question, sorry..

Here's how i'm doing it now:

// create video loader
var video:VideoLoader = new VideoLoader(VIDpath, {
   name: "video",
   autoPlay: false,
   container: this,
   alpha: 0,
   bgColor: backgroundsColor,
   bgAlpha: bgAlphaVideo,
   width: vW,
   height: vH,
   centerRegistration: true,
   scaleMode: "proportionalInside",
   onComplete: initVideo,
   onError: errorCatch,
   onProgress: updateDownloadProgress
});

// custom rmb menu
var customContextVideoMenu:ContextMenu = new ContextMenu();
// menu rmb web link
var videoMenuItem1:ContextMenuItem = new ContextMenuItem("Link");
var videoMenuItem2:ContextMenuItem = new ContextMenuItem("Video v1.23");

// hide unnecessary rmb stuff
customContextVideoMenu.hideBuiltInItems();
// add custom content
videoMenuItem2.separatorBefore = true;
customContextVideoMenu.customItems.push(videoMenuItem1, videoMenuItem2);
video.content.contextMenu = customContextVideoMenu;
videoControls.contextMenu = customContextVideoMenu;

// hyperlink function
function goVideoClever(event:ContextMenuEvent):void {
   navigateToURL(new URLRequest("http://www.google.com"),"_blank");
}

Link to comment
Share on other sites

Hi, thanks for providing the files. I looked them over and yes I can see that the right-click menu buttons don't trigger the navigateToURL function when you right-click on the actual video while it is playing. As you noted it seems to work fine if you right-click anywhere else.

 

I put a simple trace into the event handler:

 

 

function goVideoClever(event:ContextMenuEvent):void {
trace("go video clever");
navigateToURL(new URLRequest("http://www.clever-line.ru"),"_blank");
}

 

And it appears the event isn't getting fired or captured as "go video clever" never displays. At least this most likely rules out some bizarre security error.

 

Quite honestly I don't know why adding the context menu to your video.content isn't working :(

What I would suggest is this:

 

Cover the video with a transparent Sprite or MovieClip and apply the context menu to it. You would also want to also attach the CLICK eventHandler that toggles play/pause too:

 

videoCover.content.addEventListener(MouseEvent.CLICK, playPauseSwitch);

 

 

 

Hopefully that is a workable solution for you.

 

If I find something else that could be the cause of the problem I'll let you know.

  • Like 1
Link to comment
Share on other sites

Well, i was thinking of security error, coz flash usually works either on-line, either offline, but video must do both...

It's not urgent, i just wanted to know clearly what it is, so right now i'll just leave it as it now, withou sprite...

 

Would be cool to find some easy solution for this in the future :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...