music on /off script
0
Posted by
ansh
|
Monday, May 16, 2011
var music:Sound = new Sound(new URLRequest("music.mp3"));
var trans:SoundTransform = new SoundTransform(1, -1);
var channel:SoundChannel = music.play(0, 1, trans);
var musicOn:Boolean = true
onOff.addEventListener(MouseEvent.CLICK, onOffSound);
function onOffSound(e:Event) {
if (musicOn == true) {
musicOn = false;
trans.volume=0;
SoundMixer.soundTransform = trans;
} else {
musicOn = true;
trans.volume=1;
SoundMixer.soundTransform = trans;
}
}
var trans:SoundTransform = new SoundTransform(1, -1);
var channel:SoundChannel = music.play(0, 1, trans);
var musicOn:Boolean = true
onOff.addEventListener(MouseEvent.CLICK, onOffSound);
function onOffSound(e:Event) {
if (musicOn == true) {
musicOn = false;
trans.volume=0;
SoundMixer.soundTransform = trans;
} else {
musicOn = true;
trans.volume=1;
SoundMixer.soundTransform = trans;
}
}
moving object script url & changing color
0
Posted by
ansh
|
moving object script
http://www.actionscript.org/resources/articles/26/1/Drag-n-Drop-and-Drop-Target
s/Page1.html
change color
http://www.flashvault.net/tutorial.asp?ID=144
http://www.actionscript.org/resources/articles/26/1/Drag-n-Drop-and-Drop-Target
s/Page1.html
change color
http://www.flashvault.net/tutorial.asp?ID=144
Action Script 3.0 (Loading file from outside the swf)
0
Posted by
ansh
|
Tuesday, March 22, 2011
/*Mouse.hide();
stage.addEventListener(Event.ENTER_FRAME,ff);
function ff(e:Event):void{
dd.x=mouseX;
dd.y=mouseY;
}*/
stage.scaleMode = StageScaleMode.NO_SCALE;
dd.addEventListener(MouseEvent.ROLL_OVER,btn1Over);
dd.addEventListener(MouseEvent.ROLL_OUT, btn1Out);
dd.addEventListener(MouseEvent.CLICK, btn1Click);
function btn1Over(event:Event):void {
dd.gotoAndPlay("over");
}
function btn1Out(event:Event):void {
dd.gotoAndPlay("out");
}
function btn1Click(event:Event):void {
dd.gotoAndPlay("click");
}
var loade:Loader=new Loader();
dd.addEventListener(MouseEvent.CLICK,mm);
dd1.addEventListener(MouseEvent.CLICK,f1);
dd2.addEventListener(MouseEvent.CLICK,f2);
dd3.addEventListener(MouseEvent.CLICK,f3);
function mm(e:MouseEvent):void {
var ui:URLRequest=new URLRequest ("cat-buttons.jpg");
loade.load(ui);
uiloader.addChild(loade);
}
stage.addEventListener(Event.ENTER_FRAME,ff);
function ff(e:Event):void{
dd.x=mouseX;
dd.y=mouseY;
}*/
stage.scaleMode = StageScaleMode.NO_SCALE;
dd.addEventListener(MouseEvent.ROLL_OVER,btn1Over);
dd.addEventListener(MouseEvent.ROLL_OUT, btn1Out);
dd.addEventListener(MouseEvent.CLICK, btn1Click);
function btn1Over(event:Event):void {
dd.gotoAndPlay("over");
}
function btn1Out(event:Event):void {
dd.gotoAndPlay("out");
}
function btn1Click(event:Event):void {
dd.gotoAndPlay("click");
}
var loade:Loader=new Loader();
dd.addEventListener(MouseEvent.CLICK,mm);
dd1.addEventListener(MouseEvent.CLICK,f1);
dd2.addEventListener(MouseEvent.CLICK,f2);
dd3.addEventListener(MouseEvent.CLICK,f3);
function mm(e:MouseEvent):void {
var ui:URLRequest=new URLRequest ("cat-buttons.jpg");
loade.load(ui);
uiloader.addChild(loade);
}
Action Script 3.0 (mouse pointer)
0
Posted by
ansh
|
This script is using for to hide the mouse pointer and show what ever image we can given other than mouse pointer. Lets check..
//Mouse.hide();
stage.addEventListener(Event.ENTER_FRAME,ff);
function ff(e:Event):void{
aa.x=mouseX;
aa.y=mouseY;
//Mouse.hide();
stage.addEventListener(Event.ENTER_FRAME,ff);
function ff(e:Event):void{
aa.x=mouseX;
aa.y=mouseY;
Action Script 3.0 (no scaling property)
0
Posted by
ansh
|
This AS3 code is using for no scaling property in a flash website or any flash presentations
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.scaleMode = StageScaleMode.NO_SCALE;
