/////code for slide in effect
soundtab_mc.onRollOver = over;
soundtab_mc.onRollOut = out;
function over() {
this.gotoAndPlay(6);
}
function out() {
this.gotoAndPlay(11);
/////these are buttons within the MC called soundtab_mc
this.soundtab_mc.play_mc.onPress = function() {
_parent.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
soundtab_mc.onPressHandler()
};
this.soundtab_mc.stop_mc.onPress = function() {
_parent.sound_mc.sound_obj.stop();
soundtab_mc.onPressHandler()
};
this.soundtab_mc.next_mc.onPress = function() {
(song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;
_parent.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
soundtab_mc.onPressHandler()
};
this.soundtab_mc.prev_mc.onPress = function() {
(song_nr == 0) ? _global.song_nr=songfile.length-1 : _global.song_nr--;
_parent.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
};
Thanks in advance for any ideas.
I understand that on function it starts to track the accounts if mouse moves off and on goto and play when on. and after reading in some forums about deletingonEnterframe event to not hog end user computer down but i think that was cleared up by using setInterval instead, correct? so not necessary?
Also after a button is clicked once within soundtab_mc buttons become disabled if rollOver occurs again. do i need to create another handle for that? to revert it back?
this.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
this.enabled = 0;
soundtab_mc.stop_mc.enabled = 1;
//set d to true, so the tab slides back
d = 1;
};
soundtab_mc.stop_mc.onRelease = function() {
this.sound_mc.sound_obj.stop();
this.enabled = 0;
soundtab_mc.play_mc.enabled = 1;
//set d to true, so the tab slides back
d = 1;
};
soundtab_mc.next_mc.onRelease = function() {
(song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;
_root.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
//set d to true, so the tab slides back
d = 1;
};
soundtab_mc.prev_mc.onRelease = function() {
(song_nr == 0) ? _global.song_nr=songfile.length-1 : _global.song_nr--;
_root.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
//set d to true, so the tab slides back
d = 1;
};
?
scotty(-:
scotty(-:
Without a fla I think the code should read something like:
startTracking = function () {
soundtab_mc.onEnterFrame = function() {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
this.gotoAndPlay(15);
delete this.onEnterFrame;
}
};
};
scotty(-:
/////code for slide in effect
var startTracking = function() {
soundtab_mc.onEnterFrame = function() {
if(!hitTest(_xmouse,_ymouse,true)) {
soundtab_mc.enabled = true;
delete this.onEnterFrame;
this.gotoAndPlay(15);
}
}
}
/////code for buttons
soundtab_mc.play_mc.onRelease = function() {
this.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
};
soundtab_mc.stop_mc.onRelease = function() {
this.sound_mc.sound_obj.stop();
};
soundtab_mc.next_mc.onRelease = function() {
(song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;
_root.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
};
soundtab_mc.prev_mc.onRelease = function() {
(song_nr == 0) ? _global.song_nr=songfile.length-1 : _global.song_nr--;
_root.sound_mc.songStarter(songfile[song_nr], songname[song_nr]);
};
The tab slides in now. and when you attempt to click on a button within MC it doesnt do anything and then the icon for clicking turns into normal cursor. Any ideas? Thanks for the tip I think I am closer and once I grasp this I will throw a party and your invited. Sincerely stumped. MT
soundtab_mc.onRollOut = out();
I donno, but functions should have parenthesis at the end shouldnt they?
For the hitTest code, in this case it's better to use setInterval
var d = 1;
function startTracking() {
if (soundtab_mc.hitTest(_root._xmouse, _root._ymouse) && d) {
d = 0;
soundtab_mc.gotoAndPlay(2);
}
if (!soundtab_mc.hitTest(_root._xmouse, _root._ymouse)) {
if (!d) {
soundtab_mc.gotoAndPlay(15);
d = 1;
}
}
}
var delay = setInterval(startTracking, 30);
scotty(-:
scotty(-:
scotty(-:
#If you have any other info about this subject , Please add it free.# |