This script is to make volume buttons have a function in the menu.
First create a variable to add a listener:
var keyListener = new Object();
{
if (Key.getCode() == 189)
{
//do something
} // end if
if (Key.getCode() == 187)
{
//do something
} // end if
if (Key.getCode() == 39)
{
//do something
}//end if
if (Key.getCode() == 37)
{
//do something
} // end if
};
{
_root.dMc.removeMovieClip();
} // End of the function
Stage.align = "TL";
var debugObj = new Object();
{
_root.debugCreate(arg);
};
_root.ExtEvt.shakePhone.addListener(_loc2);
delete _root.debugBl;
var mmCl = Ely_CIS_MenuManager.getMenuManager(this, 12, "Soft");
{
++_global.i
_root.wallpaper.unloadMovie();
_root.wallpaper.loadMovie("HD2/Wallpapers/" + _global.i + .jpg)
if(_global.i == 54)
{
_global.i = 1
}
}
function prevWall ()
{
--_global.i
_root.wallpaper.unloadMovie();
_root.wallpaper.loadMovie("HD2/Wallpapers/" + _global.i + .jpg)
if(_global.i == 0)
{
_global.i = 54
}
}
{
_root.createEmptyMovieClip("wallpaper", 0)
}
createWall();
First create a variable to add a listener:
var keyListener = new Object();
keyListener.onKeyDown = function ()
Now create a function for the listener to detect:
{
if (Key.getCode() == 189)
{
//do something
} // end if
if (Key.getCode() == 187)
{
//do something
} // end if
if (Key.getCode() == 39)
{
//do something
}//end if
if (Key.getCode() == 37)
{
//do something
} // end if
};
Key.addListener(keyListener);
Where the words "//do something" are you put something. keycode 189 and 39 are down button, and keycode 187 and 37 are up button.
Now you have to add the listener:
function debugCreate(arg)
Now to create the function:
{
_root.dMc.removeMovieClip();
} // End of the function
_root._focusrect = false;
Now create another function to trace:
function dTrace(str)
{
++dtraceN;
_root.dMc.dTxt.text = _root.dMc.dTxt.text + ("\n" + dtraceN + " : " + str);
_root.dMc.dTxt.scroll = _root.dMc.dTxt.maxscroll;
} // End of the function
Now change the variable:
Stage.scaleMode = "noScale";
Now configure the stage:
Stage.align = "TL";
_root.ExtEvt = ExtendedEvents;
Now add a root for extended events:
var nowOs = System.capabilities.os;
Now add system capabilities variable:
var dtraceN;
Now add the variables:
var debugObj = new Object();
debugObj.onEvent = function (arg)
Now add the function:
{
_root.debugCreate(arg);
};
_root.ExtEvt.debugOn.addListener(debugObj);
Now add listeners
_root.ExtEvt.shakePhone.addListener(_loc2);
debugCreate(nowOs);
Now make a function work:
delete _root.debugBl;
_root.dTrace("nowOs : " + nowOs);
And add the script:
var mmCl = Ely_CIS_MenuManager.getMenuManager(this, 12, "Soft");
stop();
and to make sure after its done all that it finishes:
function nextWall ()
you could use this:
{
++_global.i
_root.wallpaper.unloadMovie();
_root.wallpaper.loadMovie("HD2/Wallpapers/" + _global.i + .jpg)
if(_global.i == 54)
{
_global.i = 1
}
}
function prevWall ()
{
--_global.i
_root.wallpaper.unloadMovie();
_root.wallpaper.loadMovie("HD2/Wallpapers/" + _global.i + .jpg)
if(_global.i == 0)
{
_global.i = 54
}
}
function createWall()
So when up/down button is pressed wallpaper changes, just put nextWall(); or prevWall(); where i put //do something
also first add the wallpaper movie if you are going to use this:
{
_root.createEmptyMovieClip("wallpaper", 0)
}
createWall();