Pages: [1]
  Print  
Author Topic: pause (flag:Boolean)? it doesn't work!  (Read 280 times)
qi3d
Gaia User
**
Posts: 10


« on: November 21, 2011, 05:08:30 PM »

pause (flag:Boolean)? it doesn't work! Could you tell me how to fix it? Thank you!

private function stopSound(e:MouseEvent):void
      {
         pause(flag:true);
      }

it shows: 1084: Syntax error: expecting rightparen before colon.
Logged
steven
Gaia Author
Administrator
Gaia Evangelist
*****
Posts: 3871


gaiaframework
WWW
« Reply #1 on: November 21, 2011, 05:37:58 PM »

pause(true) or pause(false);
Logged

Steven Sacks | Gaia Author
Please support Gaia by donating to the project!  Smiley
qi3d
Gaia User
**
Posts: 10


« Reply #2 on: November 21, 2011, 05:46:08 PM »

Sorry, it still doesn't work.
1180: Call to a possibly undefined method pause.
Logged
steven
Gaia Author
Administrator
Gaia Evangelist
*****
Posts: 3871


gaiaframework
WWW
« Reply #3 on: November 22, 2011, 12:44:55 AM »

I have no idea what you're doing, but it doesn't sound like you do either. You have provided no context for where this code is or what it is supposed to do.
Logged

Steven Sacks | Gaia Author
Please support Gaia by donating to the project!  Smiley
qi3d
Gaia User
**
Posts: 10


« Reply #4 on: November 22, 2011, 06:39:49 PM »

package com.v2vision.pages
{
   import com.gaiaframework.templates.AbstractPage;
   import com.gaiaframework.events.*;
   import com.gaiaframework.debug.*;
   import com.gaiaframework.api.*;
   import com.greensock.TimelineLite;
   import com.gaiaframework.assets.*;
   import flash.display.*;
   import flash.events.*;



   public class NavPage extends AbstractPage
   {
      public var stop_btn:MovieClip;
      public var play_btn:MovieClip;
                 /*button animation*/
      public var soundV:MovieClip;
      //public var myMusic:Boolean;
      public function NavPage()
      {
         super();
         //new Scaffold(this);

      }
      override public function transitionIn():void
      {
         super.transitionIn();
         gotoAndPlay("in");
         ISound(assets.myMusic).play();
         play_btn.mouseChildren = stop_btn.mouseChildren = false;
         play_btn.buttonMode = stop_btn.buttonMode = true;
         play_btn.addEventListener(MouseEvent.CLICK, playSound);
         stop_btn.addEventListener(MouseEvent.CLICK, stopSound);
      }
      override public function transitionOut():void
      {
         super.transitionOut();
         gotoAndPlay("out");
      }
      private function playSound(e:MouseEvent):void
      {
         ISound(assets.myMusic).play();
         soundV.gotoAndPlay("soundOn");
      }
      private function stopSound(e:MouseEvent):void
      {
         soundV.gotoAndStop("soundOff");
         pause(true);
      }
   }
}
Logged
qi3d
Gaia User
**
Posts: 10


« Reply #5 on: November 23, 2011, 05:23:18 AM »

Anyone can help me? I just want my stop button to pause the background music.
Logged
Ramiro
Moderator
Gaia Addict
*****
Posts: 861


interactive pragmatism


« Reply #6 on: November 23, 2011, 07:44:58 AM »

It's very basic and you've done it right by playing the sound already. copy & paste maybe? Wink

I asume you're trying to pause the sound asset:
Code:
ISound(assets.myMusic).pause(true);

I hope I don't sound too condescending, but you'll have a hard time with Gaia if you don't know at least the very basics of actionscript. For example something like "pause(flag:true);" is syntactically wrong.

Hope it helps
Logged
Pages: [1]
  Print  
 
Jump to:  

TinyPortal v1.0 beta 4 © Bloc