Hi all,
Its been a while since I last posted but I was hoping someone would be able to help me asap. I am so nearly there but something is not quite right. I have alot of faith in this forum so I’m hoping someone out there can help! Here we go:
I have various movie clips within movie clips, these all work fine. Within one of the MC’s, i have a button with instance name “left” and one called “right”. These are used to cycle through my work (this is for my portfolio). The right button works fine, just plays the timeline of the MC using frame labels. I built my site last year but its going through a complete overhaul on the structure and coding side cos quite simply, its a mess
Last year, i placed this code ON the “left” button itself:
on (release) {
firstFrame = this._currentframe;
origFrame = this._currentframe;
reversespeed = 1;
newFrame = origFrame -18;
this.onEnterFrame = function() {
if(firstFrame == newFrame){
this.onEnterFrame = null;
stop();
}else{
this.gotoAndStop(firstFrame);
firstFrame = firstFrame - reversespeed;
}
}
}
This worked fine, i would change the number (18 in this case) as necessary and it was perfect. Now, this time round, I am using instanceName.onRelease = function() and so on in an actions layer, however this doesnt work:
left.onRelease = function() {
firstFrame = this._currentframe;
origFrame = this._currentframe;
reversespeed = 1;
newFrame = origFrame -18;
this.onEnterFrame = function() {
if(firstFrame == newFrame){
this.onEnterFrame = null;
stop();
}else{
this.gotoAndStop(firstFrame);
firstFrame = firstFrame - reversespeed;
}
}
}
I dont know what i could be doing wrong. The code works on my latest version of my site when I place it on the button itself but not when its on a frame in the actions layer. To be honest I dont really understand the cde very well but I understand it enough to make it work when placed on a button but I know this isnt a very good way of coding.
If someone could please modify that code so that it would work when placed in an actions layer I would really appreciate it. Or at least explain what I’m doing wrong because I thought it would be as simple as just replacing on (release) with instance.onRelease = function()
Thanks in advance for your help and advice
Theo