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

Errors 1084 and 1086, need help !

New Here ,
Dec 18, 2014 Dec 18, 2014

Hello !

First, I apologize for my english, I'm a french graphic student trying to develop an animation in Flash, using AS3.

My problem is : I'm using a sound, and I want it to stop when you click on my object (Montagne), and then restart it if you click again.

Here's my code :

import flash.media.Sound;

import flash.media.SoundChannel;

import flash.events.MouseEvent;

import flash.net.URLRequest;

var music:Sound = new Sound(new URLRequest("fond.wav"));

var sc:SoundChannel = Sound.play();

sc.play();

Montagne.addEventListener(MouseEvent.CLICK, stopMusic);

function stopMusic(event:MouseEvent){

  if(Montagne.currentFrameLabel =="Etape_2"){

  trace("youpi");

  sc.stop();

  }else{

  (Montagne.currentFrameLabel =="Etape_3"){

  trace("itizok");

  sc.play();

  }

  }

}

I have two syntax errors that I can't correct :

1086 : expecting semicolon before left brace

1084 : expecting right brace before left brace

I googled it many times, but I'm definitively blocked...

A little help could be so great ! Thank you in advance !

TOPICS
ActionScript
214
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 ,
Dec 18, 2014 Dec 18, 2014
LATEST

try:

import flash.media.Sound;

import flash.media.SoundChannel;

import flash.events.MouseEvent;

import flash.net.URLRequest;

var music:Sound = new Sound(new URLRequest("fond.wav"));

var sc:SoundChannel = Sound.play();

Montagne.addEventListener(MouseEvent.CLICK, stopMusic);

function stopMusic(event:MouseEvent){

  if(Montagne.currentFrameLabel =="Etape_2"){

  trace("youpi");

  sc.stop();

  }else{

if  (Montagne.currentFrameLabel =="Etape_3"){

  trace("itizok");

  sc = music.play();

  }

  }

}

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