PDA

View Full Version : help with a few things.


jeremycollins
07-31-2008, 05:06 AM
Hello,

I am still a complete newb at flash and actionscripting, however I am learning :)

I am attempting to make a flash game, using Macromedia Flash 8 full version. I have been coming along great, although it is probably messy organization. I am making a simple maze game, however I need some help with just a few things.

How can I add audio to my game so that it plays a different track after the previous track ends? Is it possible to make it pick from a list of tracks and play them at random?

Is it possible to disable right clicking? This is an easy way to cheat on my game, and I don't want that.

How can I edit the audio start-in time? I want it to come in at a specific point.


These are the questions I am facing right now, and I hope I can get some answers. Thanks for your help :)

SergeantFlash
08-01-2008, 12:02 AM
You can't make the entire context menu dissapear, but you can hide the built in menu items that could cause you trouble in your game. Just add the code below:
var customContextMenu:ContextMenu = new ContextMenu();
customContextMenu.hideBuiltInItems();
this.contextMenu = customContextMenu;

There is a tutorial on custamizing the context menu in Flash HERE (http://www.developphp.com/Flash_tuts/CustomContextMenu.php).

For ActionScript 2.0, you would add this code:
stop();

var myMenu:ContextMenu = new ContextMenu();
myMenu.hideBuiltInItems();

_root.menu = myMenu;

jeremycollins
08-01-2008, 06:19 AM
Thanks! That solves my right click problem!

Now I have another issue. I am using mouse.hide to hide the curser and placing a small circle located at the cursers x and y positions. It just shows the circle throughout the game, however when you right click, the mouse pointer comes back, and it stays back. How might I fix this?

SergeantFlash
08-01-2008, 07:56 PM
Well, what you could try doing is putting the MouseHide() function inside an enter frame event (like below) so the mouse constantly stays hidden.
//method 1:
onClipEvent(enterFrame){
MouseHide();
this._x = _root._xmouse;
this._y = _root._ymouse;
}
//method 2:
onClipEvent(enterFrame){
Mouse.hide();
startDrag(this,true);
}