Skip to main content
November 19, 2011
Question

Re: Using my start button to start and stop the scene or movie.

  • November 19, 2011
  • 1 reply
  • 650 views

Here is the action scrip that I created. Correct it if you can.

Process.visible = false;

Cycles.visible = false;

stop();

function playMovie(event:MouseEvent):void

{

play();

}

startButton.addEventListener(MouseEvent.CLICK,playMovie);

var paused:Boolean = false;

function myPauseFunction():void{

     if(paused) {

          play();

          paused = false;

     }

     else {

          stop();

          paused = true;

     }

}

import flash.events.Event;

btn_show_process.addEventListener(MouseEvent.CLICK, showText);

btn_hide_process.addEventListener(MouseEvent.CLICK, hideText);

function showText(event:Event):void {

          Process.visible = true;

          Cycles.visible = true;

}

function hideText(event:Event):void {

          Process.visible = false;

          Cycles.visible = false;

}

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
November 19, 2011

There are some things you will need to do to resolve this. 

1. Indicate what is not working as you want

2. Make sure your Publish Settings are set for Actionscript 3.  This is an AS2 forum but your code is all AS3, so that might be your biggest problem.

3. Post in the AS3 forum if you intend to be using AS3.

4. Decide if you want to use that myPauseFunction.  Currently it has nothing calling upon it to work

November 22, 2011

Ned,

First of all, thank you for your input on this issue, regarding 'start and stop' button.  I'm very new with this forum so please bare with me.  I'm using CS4, I was not aware of the replies I received before, they were giving me CS3 answers.  My mistake.  I'm willing to start over fresh with a new code with a CS4.  But at this point, I'm a fish trying to swim without water, if you know what I mean.  I tried to find the forum that is CS4 to ask help regarding the 'start and stop' button, no avail.  Can you direct me the link, so I can get help with this start and stop button issue, or can you give me a quick code of a CS4 version to resolved this issue.  I really appreciate it. 

Ned Murphy
Legend
November 22, 2011

There are no CS3/CS4/CSAny forums.  "CS" refers to a version of Flash software.  "AS" refers to a version of Actionscript coding language.  I was explaining that you are posting AS3 code in an AS2 forum.  Both Flash CS3 and CS4 support AS2 and AS3, so which you choose shouldn't matter too much unless you choose to use new features of AS3 that were introduced with CS4.

If you wish to pursue an AS3 design, then here is a link to the AS3 forum:

http://forums.adobe.com/community/flash/flash_actionscript3?view=discussions