Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

HELP: PORTALS

New Here ,
Apr 06, 2007 Apr 06, 2007
i'm making a 2d side-scroller and i need some help.

I've tried to get to the next map (using play();) by these means:


onClipEvent (enterFrame) {
thingthing = 0
if (this.hitTest(_root.char)) {
thingthing==1
}
if (thingthing==1){
if(Key.isDown(Key.UP)) {
play();
}
}
}

to the movie clip portal

and

onClipEvent (enterFrame) {
if (this.hitTest(_root.char)) {
if(Key.isDown(Key.UP)) {
play();
}
}
}

and

onClipEvent (enterFrame) {
if (this.hitTest(portal)) {
if(Key.isDown(Key.UP)) {
play();
}
}



and etc. to the character but still, i can't get it to move onto the next map. does anyone know how?

What i want:

when you touch the portal, if you press up, it executes the script:

play();

thank you, and please respond quickly![/code]
TOPICS
ActionScript
433
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 07, 2007 Apr 07, 2007
if you want the main timeline to advance, use _root:


Translate
New Here ,
Apr 07, 2007 Apr 07, 2007
*BUMP* i'm desparate for help here, so please, i need views
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 07, 2007 Apr 07, 2007
play() what? there must be a movieclip timeline that you want to advance. use that movieclip's instance name and apply the play() method to that instance name.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 07, 2007 Apr 07, 2007
i want to move to the next frame, like when you press a button;

on (release) {
play();
}

then instead, i want it when the character is touching/on/in/etc. the other movie clip, when you press up, it goes to the next frame/plays
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 07, 2007 Apr 07, 2007
re-read my message.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 07, 2007 Apr 07, 2007
I don't get the complete meaning of what you are doing here, but the first thing i see is, that you probably missing a "this" in you're play() statement - like this:

onClipEvent (enterFrame) {
if (this.hitTest(portal)) {
if(Key.isDown(Key.UP)) {
this.play();
}
}
}

Is it a matter of moving to the next frame, there is a MovieClip-function called "nextFrame", which probaly could be of great help - see:

http://livedocs.adobe.com/flash/8/main/00002486.html
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 07, 2007 Apr 07, 2007
"this" is the only movieclip reference you can be sure is NOT correct.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 07, 2007 Apr 07, 2007
ahh, i get it, so my whole code is wrong. well, i don't want the clip to play, i want to whole movie to go to another frame
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 07, 2007 Apr 07, 2007
if you want the main timeline to advance, use _root:


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 07, 2007 Apr 07, 2007
Yay! thatnk you so much!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 07, 2007 Apr 07, 2007
DARN! when i'm touching the portal, andi press up, nothing happens!

Never mind,i got it to work!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 07, 2007 Apr 07, 2007
LATEST
you're welcome.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines