PDA

View Full Version : sounds in panorana


alexvesna
10-23-2007, 10:56 PM
I am not very keen in scripting. I've got a code for my panorama and now I'd like to add some sounds at the certain places in it. (Eg. When a TV appears I'd like use a sound for it. As soon as it disappears from the screen I want to fade out its sound. I've tried with setPan and _x coordinate but unfortunately it didn't work for me.
stop();
nav.attachMovie("butn", "butn1", 41);
nav.attachMovie("butn", "butn2", 42, {_x:nav.butn1._x-3738});
//nav.attachMovie("butn", "butn1", 42,{_x:-3161});
this.onEnterFrame = function() {
var xcenter = Stage.width/2;
var speed = 0.01500;
var distance = -(_root._xmouse-xcenter);
if (nav._ymouse<0 || nav._ymouse>Stage.height) {
speed = 0;
}
if ((_root._xmouse+200>Stage.width) and (_root._xmouse>xcenter)) {
speed = 0.00800;
} else {
speed = 0;
}
if ((_root._xmouse<200) and (_root._xmouse<xcenter)) {
speed = 0.00800;
} else {
//speed = 0;
}
if (nav._x<=-2738) {
nav._x += 3738;
}
if ((nav._x+20>=0) and (_root._xmouse<xcenter)) {
if (nav._x>=3738) {
nav._x -= 3738;
}
}
if ((nav._x+nav._width-190<=Stage.width) and (_root._xmouse>xcenter)) {
if (nav._x>=-2738) {
nav._x += 3738;
}
trace(nav._x);
}



nav._x = nav._x+distance*speed;
//trace(mouseMOVE);
mouseMOVE = false;
};

// loop sound


var my_loop:Sound = new Sound(_root.nav);


my_loop.attachSound("loop");
my_loop.start(1,999);


// end loop sound


Any advise will be appreciated.

atomic
10-23-2007, 10:57 PM
Can you attach your .fla?

alexvesna
10-23-2007, 11:23 PM
Thanks for your attention
Here are it is. It's a bit more than 2 mb because of sounds and video. So I posted a link to it http://www.chartpilot.ru/uslugi/foto-1/sketch.zip

atomic
10-24-2007, 12:52 AM
As I thought it might be... A CS3 format, can't open it!
I need a Flash 8 format .fla.

alexvesna
10-24-2007, 08:26 AM
I've changed it to 8 format,. Hope it'll work
http://www.chartpilot.ru/uslugi/foto-1/sketch.zip