1 Replies - 561 Views - Last Post: 09 May 2009 - 09:26 AM

#1 esco1313  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 07-May 09

SERIOUS problem ...

Posted 07 May 2009 - 06:26 AM

Ok. I'm NOT good with as. I'm building a website. i'm gona try to explain the best i can.

SO...I've had a LOT of problems with this website. so i decided to start it over. The way it is now (to fix a lot of other problems), i have a menu ON the main scene, in a mc. And to call the "sections" of the menu (example: photos), i call labeled frames, which are on the MAIN scene as well. Up to now, its working.
Next, when u click on the PHOTOS button (which is a mc as well), the background changes, and the thumbnails appear to the right (animated from outside the stage to inside...) Then, u can pic the pic u want. When you leave the section, i wanted to have the "ThumbOut" animation play and finish BEFORE the section changes.Still ok up till now.

NOW...in the photos section, i created two animations: thumbsIN and thumbsOUT, for when u get IN the section, and LEAVE the section.(OUT) i labeled the frames (thumbin, thumbout) and called those with AS. Still ok.

i then made an action to call these animations when we click on the PHOTOS mc, and SOMEHOW figured out (by copying tutorials and bits of AS:P) how to get it to animate OUT when u leave the section.
it looks like this:

on the Photo and ambiance mc (button):

on (release) {
_parent.gotoAndPlay("Ambiance");

}


On the ABOUT button (Propos)


on (release) {
_parent.thumbMc.gotoAndPlay("thumbout");
_parent.thumbMc.onEnterFrame = function() {
if (_parent.thumbMc._currentframe == 42) {
_parent.thumbMc.stop();
_root.gotoAndPlay("Propos");
}
}
}


/// "thumbout" is the frame label for the OUT which is inside the thumbMc
/// "Propos" is the frame label on the MAINSCENE (root?) which calls my other section (when the PROPOS button is clicked.

Works FINE!!! when im in the photo section, and i click on the about button, works like a charm: thumbnail animation plays, then finishes, THEN changes section.

the problem? THIS: when i'm in any other section, the About(propos) button doesnt work!!

now i think i know why, but i dont have the slightest clue on HOW to do it:
i think i need to say: if the thumbMc is already loaded, go on with the script (meaning, wait for the mc to finish before playing). if NOT, just go play the frame: "propos".

i hope that iv been not too complicated...

please help me!!

thanx!

Is This A Good Question/Topic? 0
  • +

Replies To: SERIOUS problem ...

#2 pyropenta  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 29-April 09

Re: SERIOUS problem ...

Posted 09 May 2009 - 09:26 AM

Are you stopping the gotoAndPlay("Propos"); action with an if statement:-
if (_parent.thumbMc._currentframe == 42) {
because the gotoAndPlay will


on (release) {
_parent.thumbMc.gotoAndPlay("thumbout");
_parent.thumbMc.onEnterFrame = function() {
if (_parent.thumbMc._currentframe == 42) {
_parent.thumbMc.stop();
_root.gotoAndPlay("Propos");
}
}
}

Sorry I'm CS4 and the language has changed some what but it is similar to AS1 which I also write.

if your button has the code attached to it (inside its instance) then separating the possibilities of outcome with a switch(test) may provide an option. Also putting the stop action and the gotoAndPlay("Propos") action on the frame it is that is referenced in your if statement

ie

on (release) {
switch(pageVar) //pageVar being a variable set to whichever page you display
{

case thumbPage:
_parent.thumbMc.gotoAndPlay("thumbout");
pageVar = "MainPage"
break;
case anotherPage:
_parent. anotherPage.gotoAndPlay("anotherPageOut");
pageVar = "MainPage"
break;
case yetAnotherPage:
_parent. yetAnotherPage.stop();
pageVar = "MainPage"
_root.gotoAndPlay("Propos");
break;
}
}
placing the code
_parent.thumbMc.stop();
_root.gotoAndPlay("Propos");

on thumbMc at frame 42

Hope this helps got to go diners on the table
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1