Changing a boolean inside a movieclip via the main stage.

I have a movieclip and within it is a bit of actionscript and a couple of different movieclips to make it function like the button on a ball point pen (you click it and it stays clicked until you click it again).
var booleanClick:Boolean = false;
var colorTransform:ColorTransform = optBox.transform.colorTransform;
optHitState.addEventListener(MouseEvent.CLICK, onClickHandler);
function onClickHandler(myEvent:MouseEvent){
     if (booleanClick == false ) {
          colorTransform.color = 0xB5CDE6;
          optBox.transform.colorTransform = colorTransform;
          booleanClick = true;
     } else {
          colorTransform.color = 0xFFFFFF;
          optBox.transform.colorTransform = colorTransform;
          booleanClick = false;
I have thirty-some-odd of these ball point pen movieclips on my main stage.
I want to be able to "clear" all the movieclips so that the optbox color is white and the booleanClick is false with a button that is on my main stage. Currently I've got it working for the optbox color, but when i try to trace out my boolean - it gives me nothing (not even an error).
var cClear:ColorTransform;
var optionArray = new Array ( mc1, mc2, mc3, mc4, mc5, mc6 ); // all my ball point pen movieclips are in this array.
clearButtons.addEventListener(MouseEvent.CLICK, goClear);
function goClear(e:MouseEvent):void {
     for (var i:int = 0; i < optionArray.length; i++) {
          cClear = optionArray[i].optBox.transform.colorTransform;
          cClear.color = 0xFFFFFF;
          optionArray[i].optBox.transform.colorTransform = cClear;
          trace(optionArray[i].booleanClick + i);
          optionArray[i].booleanClick = false;
          trace(optionArray[i].booleanClick + i);
I don't want to get deeper into this monster of a project without making sure this is working first. Is my boolean working and just my trace statements aren't worded right or is my method to change the boolean wrong?

I'm not sure what you are trying to trace (boolean + number?), but try changing it to...
trace(optionArray[i].booleanClick, i);
and see if that's more like what you are expecting

Similar Messages

  • Targeting A MovieClip on the main Stage....Scope Issue

    main stage------>MC1------>MC2
    on MC2's timeline I want to target objects on the main stage. Not sure on how to write that without using root. I've been trying deviations of
    MovieClip(parent).MovieClip(parent).mcName.
    Thanks

    Why can't you just use root?
    And you can just put your code in the main timeline as suggested - just dispatch an event when you want your code to run and listen for it.
    So, in your clip, on whatever frame do something like:
    dispatchEvent(new Event("runMyAnim"));
    And in the main timeline:
    someClip.someClip.addEventListener("runMyAnim", runIt, false, 0, true);
    function runIt(e:Event){
         //your code goes here

  • Migration Assistant created new account to deposit all my stuff, but I can't access that account, even after changing the password via the main acct'

    I am at my wits end.  The migration assistant created a new profile (I didnt konw that it would do this) and now I can't get into that profile with all the stuff from my old PC. 
    I have tried changing password via the main account, but to no avail.  I have researched issues with Keychain, but all it tells me to do is change the login password - that doesnt work either - I cant get to all my files.

    Migraine Assistant it's called.
    Delete the account from the main one, create a new account and transfer files manually via a regular FAT external drive you pickup at any office or computer store, Mac's can read it.

  • Photoshop elements 12 keeps wanting me to register the product after installing but keeps telling me I have no internet connection or the clock is wrong, why does it keep asking me this? I have register online via the main webpage.

    Photoshop Elements Photoshop elements 12 keeps wanting me to register the product after installing but keeps telling me I have no internet connection or the clock is wrong, why does it keep asking me this? I have register online via the main webpage.

    Hi,
    You need to sign in when using Photoshop Elements 12 as it is the method of activation. If you sign out it deactivates that installation.
    If you are having problems, see if the following helps.
    Sign in, activation, or connection errors | CS5.5 and later
    Good luck
    Brian

  • Switching touch events from symbols/classes to the main stage?

    For previous threads:
    http://forums.adobe.com/thread/864057
    http://forums.adobe.com/thread/863566
    http://forums.adobe.com/thread/864262
    http://forums.adobe.com/thread/863597
    Bug ID #2940816
    I have an app that wasn't compiling correctly. I sent the bug to Adobe who responded with a workaround. However, I can't figure out how to make their stated workaround work in my code.
    I have puzzle pieces on the stage. Each is assigned to a separate class. Inside the class I have touch events defining multiple touch events for each piece.
    I have another spot on the stage where, when it is touched, a puzzle piece appears. These are also each linked to a separate class. Inside this class I also have touch events defining multiple touch events for each piece.
    Though it works fine on my computer, it wasn't working on an iPad. Adobe said that I needed to switch the touch events so that they were assigned to the main stage instead of to each individual object.
    However, the code they gave me didn't really make sense in context and I'm confused how to implement it.
    This is the code in the class for each piece that is created when you touch the stage:
            public function GeoPiece(): void {
                if (PuzzleGlobals.currentLevel == "Name") {
                    this.gotoAndStop("wholeName");
                else if (PuzzleGlobals.currentLevel == "Abbrev") {
                    this.gotoAndStop("abbrev");
                else if (PuzzleGlobals.currentLevel == "Shape") {
                    this.gotoAndStop("shape");
                this.addEventListener(TouchEvent.TOUCH_MOVE, geoPieceBegin);
            public function geoPieceBegin (e:TouchEvent): void {
                PuzzleGlobals.pieceActive = true;
                e.target.startTouchDrag(e.touchPointID, false);
                e.target.addEventListener(TouchEvent.TOUCH_END, geoPieceEnd);
                e.target.interactionBegin();
                MovieClip(this.parent.parent).nameDisplay.gotoAndStop(e.target.abbrev);
                PuzzleGlobals.currentPiece = e.target.abbrev;
            public function geoPieceEnd (e:TouchEvent): void {
                PuzzleGlobals.pieceActive = false;
                if (currentObjOver.isLocked == true) {
                    currentObjOver.gotoAndStop ("Lock");
                else {
                    currentObjOver.gotoAndStop ("Out");
                MovieClip(this.parent.parent).nameDisplay.gotoAndStop(PuzzleGlobals.chosenPuzzle);
                e.target.stopTouchDrag(e.touchPointID);
                if (this.dropTarget.parent is GeoPuzzle) {
                    if (GeoPuzzle(this.dropTarget.parent).abbrev == e.target.abbrev) {
                        PuzzleGlobals.statesCompletedUSA++;
                        GeoPuzzle(this.dropTarget.parent).isLocked = true;
                        GeoPuzzle(this.dropTarget.parent).gotoAndStop("Lock");
                        e.target.parent.removeChild(DisplayObject(e.target));
                    else {
                        //play BOOP sound indicated wrong drop;
                if (PuzzleGlobals.statesCompletedUSA == PuzzleGlobals.TOTAL_NUMBER_USA) {
                    //play fireworks game
                else {
                    //do nothing
                e.target.removeEventListener(TouchEvent.TOUCH_END, geoPieceEnd);
            public function interactionBegin () {
                if (this.dropTarget != null && this.dropTarget.parent is GeoPuzzle) { //check to make sure it's over a puzzle piece
                    currentObjOver = GeoPuzzle(this.dropTarget.parent);
                    currentObjOver.gotoAndStop("Over");
                if (lastObjOver != currentObjOver) {
                    if (lastObjOver.isLocked == true) {
                        lastObjOver.gotoAndStop("Lock");
                    else {
                        lastObjOver.gotoAndStop("Out");
                    lastObjOver = currentObjOver;
    This is the code in the class for each piece that's already on the stage:
            public function GeoPuzzle(): void {
                if (this.isLocked == true) {
                    this.gotoAndStop ("Lock");
                if (PuzzleGlobals.pieceActive == true) {
                    this.addEventListener(TouchEvent.TOUCH_BEGIN, geoPuzzleBegin);
            public function geoPuzzleBegin (e:TouchEvent): void {
                e.target.addEventListener(TouchEvent.TOUCH_END, geoPuzzleEnd);
                e.target.gotoAndStop("Over");
                MovieClip(this.parent).nameDisplay.gotoAndStop(e.target.abbrev);
            public function geoPuzzleEnd (e:TouchEvent): void {
                if (e.target.isLocked == false) {
                    e.target.gotoAndStop("Off");
                else if (e.target.isLocked == true) {
                    e.target.gotoAndStop("Lock");
                MovieClip(this.parent).nameDisplay.gotoAndStop(PuzzleGlobals.chosenPuzzle);
                e.target.removeEventListener(TouchEvent.TOUCH_END, geoPuzzleEnd);
    You can see that each piece (whether it's already locked on the stage or movable) reacts differently to different touch events. However, this is the code that Adobe gave me as a workaround:
    this.stage.addEventListener(TouchEvent.TOUCH_BEGIN, onTouchEvent);
    this.stage.addEventListener(TouchEvent.TOUCH_MOVE, onTouchEvent);
    this.stage.addEventListener(TouchEvent.TOUCH_END, onTouchEvent);
    var beginCount:uint=0;
    var moveCount:uint=0;
    var endCount:uint=0;
    function onTouchEvent(event:TouchEvent):void{
         switch (event.type){
              case TouchEvent.TOUCH_BEGIN:
                             trace("BEGIN")
                             beginCount++;
                             square.x = event.stageX;
                             square.y = event.stageY;
                             square.startTouchDrag(event.touchPointID, false);
                             break;
              case TouchEvent.TOUCH_MOVE:
                             trace("MOVE")
                             moveCount++;
                             break;
              case TouchEvent.TOUCH_END:
                             trace("END")
                             endCount++;
                             square.stopTouchDrag(event.touchPointID);
                             break;
         trace("begin: "+beginCount+" move: "+moveCount+" end: "+endCount);
    //     countText.text = "begin: "+beginCount+" move: "+moveCount+" end: "+endCount;
    This doesn't make any sense to me because it seems that it would only work if touching the stage had to react in just a single way. I have multiple pieces that need to each react differently.
    1. The pieces that are locked to the stage need to highlight when touched and display their name.
    2. These pieces also need to keep themselves highlighted and their names displayed when the touch is dragged off of them instead of just removed.
    3. Each piece needs to be created when touching the Puzzle Piece button the stage. As these pieces are dragged, they need to highlight the pieces underneath them and unhighlight them when they are dragged off. They also need to display their own names, and lock into place when they are dragged over the correct piece.
    My questions are:
    1. Why don't touch events work in the compiler?
    2. How can I translate my current working code's touch events to all be directly linked to the stage instead of their objects?
    Thanks so much!
    Amber

    I am going to copy and paste this answer into all of the forums I've asked this question in case some noob like me comes along and needs the answer.
    I found the problem! After 3 months I finally figured out what was wrong and why my app was working in Device Central when exported as Flash 10.1 and not on my iPad when exported as AIR for iOS.
    The problem is that in the Flash runtime, if a line of code returns a bug, the flash runtime says "Error, shmerror, try again next time." So I had one if, else statement that was executing when it wasn't supposed to be - only once, at the very beginning of the program. It was throwing an error. When I exported as Flash, flash didn't care, and still executed the code later when it was supposed to. But Apple won't let their programs crash. So instead of just trying that code again, Apple decided, after the first error was thrown, that it would then COMPLETELY IGNORE that line of code. So the error was in the line where the states would unhighlight themselves. Apple just shut down that line of code, that's why it wouldn't execute properly.
    I ended up changing this line of code
    if (lastObjOver != null && lastObjOver.isLocked == true)
    which threw an error when the piece was FIRST dragged over the puzzle, to to this
    if (lastObjOver.parent != null && lastObjOver.isLocked == true)
    which wouldn't throw the error.
    Problem solved!
    If anyone else is having this problem, I suggest you do what I did. Change all your touch events to mouse events so you can run the program in the adc debugger. That's when I discovered the error being thrown.

  • Bug fix requires switching touch events from symbols/classes to the main stage?

    Also posted in Mobile Development, I'm still not sure which forum I should be in.
    For previous threads:
    http://forums.adobe.com/thread/864057
    http://forums.adobe.com/thread/863566
    http://forums.adobe.com/thread/864262
    http://forums.adobe.com/thread/863597
    Bug ID #2940816
    I  have an app that wasn't compiling correctly. I sent the bug to Adobe  who responded with a workaround. However, I can't figure out how to make  their stated workaround work in my code.
    I have puzzle  pieces on the stage. Each is assigned to a separate class. Inside the  class I have touch events defining multiple touch events for each piece.
    I  have another spot on the stage where, when it is touched, a puzzle  piece appears. These are also each linked to a separate class. Inside  this class I also have touch events defining multiple touch events for  each piece.
    Though it works fine on my computer, it wasn't  working on an iPad. Adobe said that I needed to switch the touch events  so that they were assigned to the main stage instead of to each  individual object.
    However, the code they gave me didn't really make sense in context and I'm confused how to implement it.
    This is the code in the class for each piece that is created when you touch the stage:
            public function GeoPiece(): void {
                if (PuzzleGlobals.currentLevel == "Name") {
                    this.gotoAndStop("wholeName");
                else if (PuzzleGlobals.currentLevel == "Abbrev") {
                    this.gotoAndStop("abbrev");
                else if (PuzzleGlobals.currentLevel == "Shape") {
                    this.gotoAndStop("shape");
                this.addEventListener(TouchEvent.TOUCH_MOVE, geoPieceBegin);
            public function geoPieceBegin (e:TouchEvent): void {
                PuzzleGlobals.pieceActive = true;
                e.target.startTouchDrag(e.touchPointID, false);
                e.target.addEventListener(TouchEvent.TOUCH_END, geoPieceEnd);
                e.target.interactionBegin();
                MovieClip(this.parent.parent).nameDisplay.gotoAndStop(e.target.abbrev );
                PuzzleGlobals.currentPiece = e.target.abbrev;
            public function geoPieceEnd (e:TouchEvent): void {
                PuzzleGlobals.pieceActive = false;
                if (currentObjOver.isLocked == true) {
                    currentObjOver.gotoAndStop ("Lock");
                else {
                    currentObjOver.gotoAndStop ("Out");
                MovieClip(this.parent.parent).nameDisplay.gotoAndStop(PuzzleGlobals.c hosenPuzzle);
                e.target.stopTouchDrag(e.touchPointID);
                if (this.dropTarget.parent is GeoPuzzle) {
                    if (GeoPuzzle(this.dropTarget.parent).abbrev == e.target.abbrev) {
                        PuzzleGlobals.statesCompletedUSA++;
                        GeoPuzzle(this.dropTarget.parent).isLocked = true;
                        GeoPuzzle(this.dropTarget.parent).gotoAndStop("Lock");
                        e.target.parent.removeChild(DisplayObject(e.target));
                    else {
                        //play BOOP sound indicated wrong drop;
                if (PuzzleGlobals.statesCompletedUSA == PuzzleGlobals.TOTAL_NUMBER_USA) {
                    //play fireworks game
                else {
                    //do nothing
                e.target.removeEventListener(TouchEvent.TOUCH_END, geoPieceEnd);
            public function interactionBegin () {
                 if (this.dropTarget != null && this.dropTarget.parent is  GeoPuzzle) { //check to make sure it's over a puzzle piece
                    currentObjOver = GeoPuzzle(this.dropTarget.parent);
                    currentObjOver.gotoAndStop("Over");
                if (lastObjOver != currentObjOver) {
                    if (lastObjOver.isLocked == true) {
                        lastObjOver.gotoAndStop("Lock");
                    else {
                        lastObjOver.gotoAndStop("Out");
                    lastObjOver = currentObjOver;
    This is the code in the class for each piece that's already on the stage:
            public function GeoPuzzle(): void {
                if (this.isLocked == true) {
                    this.gotoAndStop ("Lock");
                if (PuzzleGlobals.pieceActive == true) {
                    this.addEventListener(TouchEvent.TOUCH_BEGIN, geoPuzzleBegin);
            public function geoPuzzleBegin (e:TouchEvent): void {
                e.target.addEventListener(TouchEvent.TOUCH_END, geoPuzzleEnd);
                e.target.gotoAndStop("Over");
                MovieClip(this.parent).nameDisplay.gotoAndStop(e.target.abbrev);
            public function geoPuzzleEnd (e:TouchEvent): void {
                if (e.target.isLocked == false) {
                    e.target.gotoAndStop("Off");
                else if (e.target.isLocked == true) {
                    e.target.gotoAndStop("Lock");
                MovieClip(this.parent).nameDisplay.gotoAndStop(PuzzleGlobals.chosenPu zzle);
                e.target.removeEventListener(TouchEvent.TOUCH_END, geoPuzzleEnd);
    You  can see that each piece (whether it's already locked on the stage or  movable) reacts differently to different touch events. However, this is  the code that Adobe gave me as a workaround:
    this.stage.addEventListener(TouchEvent.TOUCH_BEGIN, onTouchEvent);
    this.stage.addEventListener(TouchEvent.TOUCH_MOVE, onTouchEvent);
    this.stage.addEventListener(TouchEvent.TOUCH_END, onTouchEvent);
    var beginCount:uint=0;
    var moveCount:uint=0;
    var endCount:uint=0;
    function onTouchEvent(event:TouchEvent):void{
         switch (event.type){
              case TouchEvent.TOUCH_BEGIN:
               &nbs p;           &n bsp; trace("BEGIN")
               &nbs p;           &n bsp; beginCount++;
               &nbs p;           &n bsp; square.x = event.stageX;
               &nbs p;           &n bsp; square.y = event.stageY;
               &nbs p;           &n bsp; square.startTouchDrag(event.touchPointID, false);
               &nbs p;           &n bsp; break;
              case TouchEvent.TOUCH_MOVE:
               &nbs p;           &n bsp; trace("MOVE")
               &nbs p;           &n bsp; moveCount++;
               &nbs p;           &n bsp; break;
              case TouchEvent.TOUCH_END:
               &nbs p;           &n bsp; trace("END")
               &nbs p;           &n bsp; endCount++;
               &nbs p;           &n bsp; square.stopTouchDrag(event.touchPointID);
               &nbs p;           &n bsp; break;
         trace("begin: "+beginCount+" move: "+moveCount+" end: "+endCount);
    //     countText.text = "begin: "+beginCount+" move: "+moveCount+" end: "+endCount;
    This  doesn't make any sense to me because it seems that it would only work  if touching the stage had to react in just a single way. I have multiple  pieces that need to each react differently.
    1. The pieces that are locked to the stage need to highlight when touched and display their name.
    2.  These pieces also need to keep themselves highlighted and their names  displayed when the touch is dragged off of them instead of just removed.
    3.  Each piece needs to be created when touching the Puzzle Piece button  the stage. As these pieces are dragged, they need to highlight the  pieces underneath them and unhighlight them when they are dragged off.  They also need to display their own names, and lock into place when they  are dragged over the correct piece.
    My questions are:
    1. Why don't touch events work in the compiler?
    2. How can I translate my current working code's touch events to all be directly linked to the stage instead of their objects?
    Thanks so much!
    Amber

    Sure!
    I haven't changed much. I've been playing around and I think I know where the problem is coming from now. I just can't figure out how to fix it.
    This it the only code I've modified:
            public function interactionBegin () {
                trace ("Current: " + currentObjOver);
                trace ("Last: " + lastObjOver);
                if (this.dropTarget != null && this.dropTarget.parent is GeoPuzzle) { //check to make sure it's over a puzzle piece
                    currentObjOver = GeoPuzzle(this.dropTarget.parent); //make "currentObjOver" assigned to the puzzle piece the finger is currently touching
                    currentObjOver.gotoAndStop("Over"); //highlight the current piece
                    if (currentObjOver != lastObjOver) { //if your finger moves and you're now touching a different state
                        if (lastObjOver != null && lastObjOver.isLocked == true) { //if the previous state you were touching has been solved
                            lastObjOver.gotoAndStop("Lock"); //lock this state into place
                        else if (lastObjOver != null && lastObjOver.isLocked == false) { //if the previous state you were touching wasn't solved
                            lastObjOver.gotoAndStop("Off"); //unhighlight that state
                        lastObjOver = currentObjOver; //assign the current state to be the last state you were touching
    lastObjOver and currentObjOver are always assigned the same object. I can't figure out why, I've run it line by line but I can't figure out where I'm going wrong.

  • Call function, pass value, access variable in movieclip class from main stage

    i am new to flash as.
    I got quite confused on some problems. as the function here
    is quite different from c and asp.net.
    I have a movieClip named MC, and it's enabled with action
    script, with the class name MC_Rectangle
    and a Stage.
    I override the MC_Rectangle class file in a mc_rectangle.as
    external file.
    here is the code:
    package{
    import flash.display.*;
    import flash.events.*;
    public class MC_Rectangle extends MovieClip {
    var sequence:int = new int();
    function setSequence(data:int):void{
    sequence = data;
    function addSequence():void{
    sequence ++;
    I have new a object in the main stage var
    mc_rect:MC_Rectangle = new MC_Rectangle()
    question:
    in main stage:
    1. how can i access the variable "sequence" in "mc_rect"
    2. how can i pass parametre from main stage to mc_rect via
    function setSequence(data:int)?
    3. how can i call the function in addSequence() in mc_rect.
    in asp.net, i usually use mc_rect.sequenct,
    mc_rect.setSequence(data), mc_rect.addSequence() to achieve my
    goals......
    btw, can function in mc_rect return out result to main stage?
    thanks in advance.

    Your as-file must be named MC_Rectangle.as (same upper/lower
    case as in the Class name)
    Ad 1) You have to declare sequence as a public property
    "public var sequence;" or - better - define a getter-function for
    sequence.
    Ad 2) mc_rect.setSequence(8); e. g. (you must write "public"
    in the Class-declaration of setSequence)
    Ad 3) mc_rect.addSequence(); e. g. (you must write "public"
    in the Class-declaration of addSequence)
    ... and yes, your methods can return a value: Replace "void"
    with the proper data type (int, String, ...) and place a "return
    myNumber;" or the like in the method's body.

  • Access a nested symbol timeline from the main stage

    Hi all,
    Would love some help on accessing a nested symbol from the main stage please.
    To set the scene.....
    "Its an autumn day..
    no sorry...just joking...
    So i have a symbol called "NormalAnatomy" - its not on the main stage, but when a button is clicked it appears in the 'content' box which is just a rectangle on the main stage.
    Inside "NormalAnatomy" symbol is another symbol called "Scrub_all" which is an animation
    For users to view the animation they use a scrub bar like this lovely lady has invented:
    Create Click and Touch Draggable Scrubbers with Edge Animate CC | sarahjustine.com
    So for Sarah Justines scrubber to work - the main stage has a lot of actions added to it. Also the "timelinePlay" symbol is on the main stage
    Its starts:
    var symDur = sym.getSymbol("timelinePlay").getDuration();
    var mySymbol = sym.getSymbol("timelinePlay");
    var scrubber = sym.$("scrubber");
    var bar = sym.$("bar");
    sym.$("mobileHit").hide();
    var dragme = false;
    So I put my "NormalAnatomy" symbol on my main stage to see if the code would work and changed all the relevant details.. and indeed it worked!
    var symDur = sym.getSymbol("NormalAnatomy").getSymbol("Scrub_all").getDuration();
    var mySymbol = sym.getSymbol("NormalAnatomy").getSymbol("Scrub_all");
    var scrubber = sym.getSymbol("NormalAnatomy").$("scrubber");
    var bar = sym.getSymbol("NormalAnatomy").$("bar");
    sym.getSymbol("NormalAnatomy").$("mobileHit").hide();
    var dragme = false;
    But i don't want the "NormalAnatomy" symbol to be on the main stage as I want it to appear in the 'content' box only when i hit a btn
    So as soon as I took this symbol off the main stage, the scrubber doesn't work. So I click a btn, and the symbol appears in the content box but the scrubber doesn't work.
    so I tried in front of the "NormalAnatomy"
    getStage().
    getStage("content").
    getComposition().getStage().
    getSymbol("content").
    but nothing works
    The main problem must be the fact that the NormalAnatomy symbol appears inside a content box so the MainStage actions doesn't know how to find it??
    So my question is... what should I put in the main stage actions to make it access the "NormalAnatomy" symbol?
    Thanks for your help in advance!

    On click handler for the symbol use
    sym.getComposition().getStage().getSymbol("nameofsymbol").play();
    or
    sym.getSymbol("nameofsymbol").play();
    replace the italics with the literal name of the symbol as it appears in the Elements panel.
    Some API details found here (http://www.adobe.com/devnet-docs/edgeanimate/api/current/index.html) in the Work With Symbols section.
    Darrell

  • Problem with access into the main stage

    hi, how are you guys ,, i hope you fine
    here is my problem
    i have file fla called "game.fla" and there are alot of frames in the main stage  i wanna move it from
    class called "admin" in the library but how??
    i tried to this
    parent.gotoAndStop(39);
    but it doesn.t work i dont know why
    and this is the error message
    C:\Users\win7\Desktop\game1\admin1.as, Line 902 1061: Call to a possibly undefined method gotoAndStop through a reference with static type flash.display:DisplayObjectContainer.

    ahh sorry "
    I could be more help if I had some code to look at"
    here this is all the admin code
    package{
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    import flash.events.Event;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    public class admin1 extends MovieClip
    var moves:Boolean;
    var points:Number;
    var SCREAMING:screaming
    var SOUNDCHANNEL:SoundChannel
    var vx:Number;
    var EATING:eating;
    var CHIDORI:chidori
    var WIND:wind;
    public function admin1(){
      addEventListener(Event.ADDED_TO_STAGE,onAddedToStage)
      public function onAddedToStage(event:Event):void
       stop()
       if (currentFrame ==20)
       gotoAndStop(1)
       WIND = new wind;
       SOUNDCHANNEL = WIND.play(0,1000)
       CHIDORI = new chidori
       EATING = new eating
       SCREAMING = new screaming
        SOUNDCHANNEL = new SoundChannel
       score.restrict = "0-9";
       burger1.enabled = false;
       fireball1.enabled = false;
       burger1.alpha = .5;
       fireball1.alpha = .5;
       points=0;
       hero1.stop();
       quizz.stop();
       animal1.stop();
       evil1.stop();
       addEventListener(Event.ENTER_FRAME, onEnterFrame);
       fireball1..addEventListener(MouseEvent.CLICK, onfireball1);
       burger1.addEventListener(MouseEvent.CLICK, onburger1);
       b1.visible = false
       b2.visible = false
       b3.visible = false
       c1.visible = false
       c2.visible = false
       c3.visible = false
       d1.visible = false
       d2.visible = false
       d3.visible = false
       e1.visible = false
       e2.visible = false
       e3.visible = false
       f1.visible = false
       f2.visible = false
       f3.visible = false
       a1.addEventListener(MouseEvent.CLICK, onmouseclicka1);
       a2.addEventListener(MouseEvent.CLICK, onmouseclicka2);
       a3.addEventListener(MouseEvent.CLICK, onmouseclicka3);
       b1.addEventListener(MouseEvent.CLICK, onmouseclickb1);
       b2.addEventListener(MouseEvent.CLICK, onmouseclickb2);
       b3.addEventListener(MouseEvent.CLICK, onmouseclickb3);
       c1.addEventListener(MouseEvent.CLICK, onmouseclickc1);
           c2.addEventListener(MouseEvent.CLICK, onmouseclickc2);
           c3.addEventListener(MouseEvent.CLICK, onmouseclickc3);
           d1.addEventListener(MouseEvent.CLICK, onmouseclickd1);
           d2.addEventListener(MouseEvent.CLICK, onmouseclickd2);
           d3.addEventListener(MouseEvent.CLICK, onmouseclickd3);
           e1.addEventListener(MouseEvent.CLICK, onmouseclicke1);
           e2.addEventListener(MouseEvent.CLICK, onmouseclicke2);
           e3.addEventListener(MouseEvent.CLICK, onmouseclicke3);
           f1.addEventListener(MouseEvent.CLICK, onmouseclickf1);
       f2.addEventListener(MouseEvent.CLICK, onmouseclickf2);
       f3.addEventListener(MouseEvent.CLICK, onmouseclickf3);
       addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
      public function onRemovedFromStage(event:Event):void
       //Remove the onEnterFrame event if
       //this object is removed from the stage
       removeEventListener(Event.ENTER_FRAME, onEnterFrame);
       removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
       removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
       trace("Dungeon removed");
      public function onEnterFrame(event:Event):void
       if (points == 0   ){
    fireball1.alpha = .3;
    fireball1.enabled = false;
    burger1.alpha = .3;
    burger1.enabled = false;
    if (points == 1   ){
    fireball1.alpha = .3;
    fireball1.enabled = false;
    burger1.alpha = 1;
    burger1.enabled = true;
    if (herobar.width == 80){
       hero1.gotoAndStop(1);}
    if (herobar.width == 60){
       hero1.gotoAndStop(2);}
       else if (herobar.width == 40){
       hero1.gotoAndStop(3);}
       else if (herobar.width == 20){
       hero1.gotoAndStop(4);}
       else if (herobar.width == 0){
       hero1.gotoAndStop(5);}
       if(evilbar.width == 40)
       evil1.gotoAndStop (2)
       else if (evilbar.width == 0){
       evil1.gotoAndStop(3);}
    public function onmouseclicka1 (event:MouseEvent):void
    points--
    if (points == 1 ){
      burger1.enabled = true;
    burger1.alpha = 1;
    if ( points == 2 || points == 3 || points == 4 || points == 5 || points == 6){
    burger1.enabled = true;
       fireball1.enabled = true;
       burger1.alpha = 1;
       fireball1.alpha = 1;
    else if (points==0){
    burger1.enabled = false;
       fireball1.enabled = false;
       burger1.alpha = .3;
       fireball1.alpha = .3;
    else if (points==1){
    fireball1.alpha = .3;
    fireball1.enabled = false;
    score.text = String(points);
    if (score.text < "0" ){
    score.text = "0";}
    if (points< 0){
    points = 0;
    trace(points)
    removeEventListener (MouseEvent.CLICK,onmouseclicka1)
    quizz.gotoAndStop(2);
    animal1.gotoAndStop(2);
    removeChild(a1)
    removeChild(a2)
    removeChild(a3)
    b1.visible = true
       b2.visible = true
       b3.visible = true
       herobar.width -= 20;
       play();
       SOUNDCHANNEL = CHIDORI.play();
    public function onmouseclicka2 (event:MouseEvent):void
    points++
    if (points == 1 ){
      burger1.enabled = true;
    burger1.alpha = 1;
    if ( points == 2 || points == 3 || points == 4 || points == 5 || points == 6){
    burger1.enabled = true;
       fireball1.enabled = true;
       burger1.alpha = 1;
       fireball1.alpha = 1;
    else if (points==0){
    burger1.enabled = false;
       fireball1.enabled = false;
       burger1.alpha = .3;
       fireball1.alpha = .3;
    score.text = String(points);
    if (score.text < "0" ){
    score.text = "0";}
    if (points< 0){
    points = 0;
    trace(points)
    removeEventListener (MouseEvent.CLICK,onmouseclicka2)
    quizz.gotoAndStop(2);
    animal1.gotoAndStop(2);
    removeChild(a1)
    removeChild(a2)
    removeChild(a3)
    b1.visible = true
       b2.visible = true
       b3.visible = true
       herobar.width -= 20;
       SOUNDCHANNEL = CHIDORI.play();
    public function onmouseclicka3 (event:MouseEvent):void
    points--
    if (points == 1 ){
      burger1.enabled = true;
    burger1.alpha = 1;
    if ( points == 2 || points == 3 || points == 4 || points == 5 || points == 6){
    burger1.enabled = true;
       fireball1.enabled = true;
       burger1.alpha = 1;
       fireball1.alpha = 1;
    else if (points==0){
    burger1.enabled = false;
       fireball1.enabled = false;
       burger1.alpha = .3;
       fireball1.alpha = .3;
    score.text = String(points);
    if (score.text < "0" ){
    score.text = "0";
    if (points< 0){
    points = 0;
    removeEventListener (MouseEvent.CLICK,onmouseclicka3)
    quizz.gotoAndStop(2);
    animal1.gotoAndStop(2);
    removeChild(a1)
    removeChild(a2)
    removeChild(a3)
    b1.visible = true
       b2.visible = true
       b3.visible = true
       herobar.width -= 20;
       SOUNDCHANNEL = CHIDORI.play();
    public function onmouseclickb1 (event:MouseEvent):void
    points--
    if (points == 1 ){
      burger1.enabled = true;
    burger1.alpha = 1;
    if ( points == 2 || points == 3 || points == 4 || points == 5 || points == 6){
    burger1.enabled = true;
       fireball1.enabled = true;
       burger1.alpha = 1;
       fireball1.alpha = 1;
    else if (points==0){
    burger1.enabled = false;
       fireball1.enabled = false;
       burger1.alpha = .3;
       fireball1.alpha = .3;
    else if (points==1){
    fireball1.alpha = .3;
    fireball1.enabled = false;
    score.text = String(points);
    if (score.text < "0" ){
    score.text = "0";}
    if (points< 0){
    points = 0;
    trace(points)
    quizz.frame.gotoAndStop(3);
    animal1.gotoAndStop(3);
    removeChild(b1)
    removeChild(b2)
    removeChild(b3)
    c1.visible = true
       c2.visible = true
       c3.visible = true
       herobar.width -= 20;
       SOUNDCHANNEL = CHIDORI.play();
    public function onmouseclickb2 (event:MouseEvent):void
    points++
    if (points == 1 ){
      burger1.enabled = true;
    burger1.alpha = 1;
    if ( points == 2 || points == 3 || points == 4 || points == 5 || points == 6){
    burger1.enabled = true;
       fireball1.enabled = true;
       burger1.alpha = 1;
       fireball1.alpha = 1;
    else if (points==0){
    burger1.enabled = false;
       fireball1.enabled = false;
       burger1.alpha = .3;
       fireball1.alpha = .3;
    score.text = String(points);
    if (score.text < "0" ){
    score.text = "0";}
    if (points< 0){
    points = 0;
    trace(points)
    quizz.gotoAndStop(3);
    animal1.gotoAndStop(3);
    removeChild(b1)
    removeChild(b2)
    removeChild(b3)
    c1.visible = true
       c2.visible = true
       c3.visible = true
       herobar.width -= 20;
       SOUNDCHANNEL = CHIDORI.play();
    public function onmouseclickb3 (event:MouseEvent):void
    points--
    if (points == 1 ){
      burger1.enabled = true;
    burger1.alpha = 1;
    if ( points == 2 || points == 3 || points == 4 || points == 5 || points == 6){
    burger1.enabled = true;
       fireball1.enabled = true;
       burger1.alpha = 1;
       fireball1.alpha = 1;
    else if (points==0){
    burger1.enabled = false;
       fireball1.enabled = false;
       burger1.alpha = .3;
       fireball1.alpha = .3;
    score.text = String(points);
    if (score.text < "0" ){
    score.text = "0";
    if (points< 0){
    points = 0;
    quizz.gotoAndStop(3);
    animal1.gotoAndStop(3);
    removeChild(b1)
    removeChild(b2)
    removeChild(b3)
    c1.visible = true
       c2.visible = true
       c3.visible = true
       herobar.width -= 20;
       SOUNDCHANNEL = CHIDORI.play();
    }public function onmouseclickc1 (event:MouseEvent):void
    points--
    if (points == 1 ){
      burger1.enabled = true;
    burger1.alpha = 1;
    if ( points == 2 || points == 3 || points == 4 || points == 5 || points == 6){
    burger1.enabled = true;
       fireball1.enabled = true;
       burger1.alpha = 1;
       fireball1.alpha = 1;
    else if (points==0){
    burger1.enabled = false;
       fireball1.enabled = false;
       burger1.alpha = .3;
       fireball1.alpha = .3;
    else if (points==1){
    fireball1.alpha = .3;
    fireball1.enabled = false;
    score.text = String(points);
    if (score.text < "0" ){
    score.text = "0";}
    if (points< 0){
    points = 0;
    trace(points)
    quizz.gotoAndStop(4);
    animal1.gotoAndStop(4);
    removeChild(c1)
    removeChild(c2)
    removeChild(c3)
    d1.visible = true
       d2.visible = true
       d3.visible = true
       herobar.width -= 20;
       SOUNDCHANNEL = CHIDORI.play();
    public function onmouseclickc2 (event:MouseEvent):void
    points++
    if (points == 1 ){
      burger1.enabled = true;
    burger1.alpha = 1;
    if ( points == 2 || points == 3 || points == 4 || points == 5 || points == 6){
    burger1.enabled = true;
       fireball1.enabled = true;
       burger1.alpha = 1;
       fireball1.alpha = 1;
    else if (points==0){
    burger1.enabled = false;
       fireball1.enabled = false;
       burger1.alpha = .3;
       fireball1.alpha = .3;
    score.text = String(points);
    if (score.text < "0" ){
    score.text = "0";}
    if (points< 0){
    points = 0;
    trace(points)
    quizz.gotoAndStop(4);
    animal1.gotoAndStop(4);
    removeChild(c1)
    removeChild(c2)
    removeChild(c3)
    d1.visible = true
       d2.visible = true
       d3.visible = true
       herobar.width -= 20;
       SOUNDCHANNEL = CHIDORI.play();
    public function onmouseclickc3 (event:MouseEvent):void
    points--
    if (points == 1 ){
      burger1.enabled = true;
    burger1.alpha = 1;
    if ( points == 2 || points == 3 || points == 4 || points == 5 || points == 6){
    burger1.enabled = true;
       fireball1.enabled = true;
       burger1.alpha = 1;
       fireball1.alpha = 1;
    else if (points==0){
    burger1.enabled = false;
       fireball1.enabled = false;
       burger1.alpha = .3;
       fireball1.alpha = .3;
    score.text = String(points);
    if (score.text < "0" ){
    score.text = "0";
    if (points< 0){
    points = 0;
    quizz.gotoAndStop(4);
    animal1.gotoAndStop(4);
    removeChild(c1)
    removeChild(c2)
    removeChild(c3)
    d1.visible = true
       d2.visible = true
       d3.visible = true
       herobar.width -= 20;
       SOUNDCHANNEL = CHIDORI.play();
    }public function onmouseclickd1 (event:MouseEvent):void
    points--
    if (points == 1 ){
      burger1.enabled = true;
    burger1.alpha = 1;
    if ( points == 2 || points == 3 || points == 4 || points == 5 || points == 6){
    burger1.enabled = true;
       fireball1.enabled = true;
       burger1.alpha = 1;
       fireball1.alpha = 1;
    else if (points==0){
    burger1.enabled = false;
       fireball1.enabled = false;
       burger1.alpha = .3;
       fireball1.alpha = .3;
    else if (points==1){
    fireball1.alpha = .3;
    fireball1.enabled = false;
    score.text = String(points);
    if (score.text < "0" ){
    score.text = "0";}
    if (points< 0){
    points = 0;
    trace(points)
    quizz.gotoAndStop(5);
    animal1.gotoAndStop(5);
    removeChild(d1)
    removeChild(d2)
    removeChild(d3)
    e1.visible = true
       e2.visible = true
       e3.visible = true
       herobar.width -= 20;
       SOUNDCHANNEL = CHIDORI.play();
    public function onmouseclickd2 (event:MouseEvent):void
    points++
    if (points == 1 ){
      burger1.enabled = true;
    burger1.alpha = 1;
    if ( points == 2 || points == 3 || points == 4 || points == 5 || points == 6){
    burger1.enabled = true;
       fireball1.enabled = true;
       burger1.alpha = 1;
       fireball1.alpha = 1;
    else if (points==0){
    burger1.enabled = false;
       fireball1.enabled = false;
       burger1.alpha = .3;
       fireball1.alpha = .3;
    score.text = String(points);
    if (score.text < "0" ){
    score.text = "0";}
    if (points< 0){
    points = 0;
    trace(points)
    quizz.gotoAndStop(5);
    animal1.gotoAndStop(5);
    removeChild(d1)
    removeChild(d2)
    removeChild(d3)
    e1.visible = true
       e2.visible = true
       e3.visible = true
       herobar.width -= 20;
       SOUNDCHANNEL = CHIDORI.play();
    public function onmouseclickd3 (event:MouseEvent):void
    points--
    if (points == 1 ){
      burger1.enabled = true;
    burger1.alpha = 1;
    if ( points == 2 || points == 3 || points == 4 || points == 5 || points == 6){
    burger1.enabled = true;
       fireball1.enabled = true;
       burger1.alpha = 1;
       fireball1.alpha = 1;
    else if (points==0){
    burger1.enabled = false;
       fireball1.enabled = false;
       burger1.alpha = .3;
       fireball1.alpha = .3;
    score.text = String(points);
    if (score.text < "0" ){
    score.text = "0";
    if (points< 0){
    points = 0;
    quizz.gotoAndStop(5);
    animal1.gotoAndStop(5);
    removeChild(d1)
    removeChild(d2)
    removeChild(d3)
    e1.visible = true
       e2.visible = true
       e3.visible = true
       herobar.width -= 20;
       SOUNDCHANNEL = CHIDORI.play();
    }public function onmouseclicke1 (event:MouseEvent):void
    points--
    if (points == 1 ){
      burger1.enabled = true;
    burger1.alpha = 1;
    if ( points == 2 || points == 3 || points == 4 || points == 5 || points == 6){
    burger1.enabled = true;
       fireball1.enabled = true;
       burger1.alpha = 1;
       fireball1.alpha = 1;
    else if (points==0){
    burger1.enabled = false;
       fireball1.enabled = false;
       burger1.alpha = .3;
       fireball1.alpha = .3;
    else if (points==1){
    fireball1.alpha = .3;
    fireball1.enabled = false;
    score.text = String(points);
    if (score.text < "0" ){
    score.text = "0";}
    if (points< 0){
    points = 0;
    trace(points)
    quizz.gotoAndStop(6);
    animal1.gotoAndStop(6);
    removeChild(e1)
    removeChild(e2)
    removeChild(e3)
    f1.visible = true
       f2.visible = true
       f3.visible = true
       herobar.width -= 20;
       SOUNDCHANNEL = CHIDORI.play();
    public function onmouseclicke2 (event:MouseEvent):void
    points++
    if (points == 1 ){
      burger1.enabled = true;
    burger1.alpha = 1;
    if ( points == 2 || points == 3 || points == 4 || points == 5 || points == 6){
    burger1.enabled = true;
       fireball1.enabled = true;
       burger1.alpha = 1;
       fireball1.alpha = 1;
    else if (points==0){
    burger1.enabled = false;
       fireball1.enabled = false;
       burger1.alpha = .3;
       fireball1.alpha = .3;
    score.text = String(points);
    if (score.text < "0" ){
    score.text = "0";}
    if (points< 0){
    points = 0;
    trace(points)
    quizz.gotoAndStop(6);
    animal1.gotoAndStop(6);
    removeChild(e1)
    removeChild(e2)
    removeChild(e3)
    f1.visible = true
       f2.visible = true
       f3.visible = true
       herobar.width -= 20;
       SOUNDCHANNEL = CHIDORI.play();
    public function onmouseclicke3 (event:MouseEvent):void
    points--
    if (points == 1 ){
      burger1.enabled = true;
    burger1.alpha = 1;
    if ( points == 2 || points == 3 || points == 4 || points == 5 || points == 6){
    burger1.enabled = true;
       fireball1.enabled = true;
       burger1.alpha = 1;
       fireball1.alpha = 1;
    else if (points==0){
    burger1.enabled = false;
       fireball1.enabled = false;
       burger1.alpha = .3;
       fireball1.alpha = .3;
    score.text = String(points);
    if (score.text < "0" ){
    score.text = "0";
    if (points< 0){
    points = 0;
    quizz.gotoAndStop(6);
    animal1.gotoAndStop(6);
    removeChild(e1)
    removeChild(e2)
    removeChild(e3)
    herobar.width -= 20;
    SOUNDCHANNEL = CHIDORI.play();
    public function onmouseclickf1 (event:MouseEvent):void
    points--
    if (points == 1 ){
      burger1.enabled = true;
    burger1.alpha = 1;
    if ( points == 2 || points == 3 || points == 4 || points == 5 || points == 6){
    burger1.enabled = true;
       fireball1.enabled = true;
       burger1.alpha = 1;
       fireball1.alpha = 1;
    else if (points==0){
    burger1.enabled = false;
       fireball1.enabled = false;
       burger1.alpha = .3;
       fireball1.alpha = .3;
    else if (points==1){
    fireball1.alpha = .3;
    fireball1.enabled = false;
    score.text = String(points);
    if (score.text < "0" ){
    score.text = "0";}
    if (points< 0){
    points = 0;
    trace(points)
    quizz.gotoAndStop(7);
    animal1.gotoAndStop(7);
    removeChild(f1)
    removeChild(f2)
    removeChild(f3)
    herobar.width -= 20;
    SOUNDCHANNEL = CHIDORI.play();
    public function onmouseclickf2 (event:MouseEvent):void
    points++
    if (points == 1 ){
      burger1.enabled = true;
    burger1.alpha = 1;
    if ( points == 2 || points == 3 || points == 4 || points == 5 || points == 6){
    burger1.enabled = true;
       fireball1.enabled = true;
       burger1.alpha = 1;
       fireball1.alpha = 1;
    else if (points==0){
    burger1.enabled = false;
       fireball1.enabled = false;
       burger1.alpha = .3;
       fireball1.alpha = .3;
    score.text = String(points);
    if (score.text < "0" ){
    score.text = "0";}
    if (points< 0){
    points = 0;
    trace(points)
    quizz.gotoAndStop(7);
    animal1.gotoAndStop(7);
    removeChild(f1)
    removeChild(f2)
    removeChild(f3)
    herobar.width -= 20;
    SOUNDCHANNEL = CHIDORI.play();
    public function onmouseclickf3 (event:MouseEvent):void
    points--
    if (points == 1 ){
      burger1.enabled = true;
    burger1.alpha = 1;
    if ( points == 2 || points == 3 || points == 4 || points == 5 || points == 6){
    burger1.enabled = true;
       fireball1.enabled = true;
       burger1.alpha = 1;
       fireball1.alpha = 1;
    else if (points==0){
    burger1.enabled = false;
       fireball1.enabled = false;
       burger1.alpha = .3;
       fireball1.alpha = .3;
    score.text = String(points);
    if (score.text < "0" ){
    score.text = "0";
    if (points< 0){
    points = 0;
    quizz.gotoAndStop(7);
    animal1.gotoAndStop(7);
    removeChild(f1)
    removeChild(f2)
    removeChild(f3)
    herobar.width -= 20;
    SOUNDCHANNEL = CHIDORI.play();
    public function onfireball1(event:MouseEvent):void{
    if ( points >= 2 ){
    points -= 2
    evilbar.width -=40
    SOUNDCHANNEL = SCREAMING.play();
    parent.gotoAndPlay(39)
    score.text = String(points);
    if (score.text < "0" ){
    score.text = "0";
    if (points< 0){
    points = 0;
    public function onburger1(event:MouseEvent):void{
    if (points == 1 ){
    burger1.alpha = .3;
    fireball1.alpha = .3;
    burger1.enabled = false;
    fireball1.enabled = false;
    herobar.width +=20
    SOUNDCHANNEL = EATING.play()
    points--
    if ( points >=  2 ){
    burger1.enabled = true;
       fireball1.enabled = true;
       burger1.alpha = 1;
       fireball1.alpha = 1;
       herobar.width +=20
       points--
       SOUNDCHANNEL = EATING.play()
    else if (points==0){
    burger1.enabled = false;
       fireball1.enabled = false;
       burger1.alpha = .3;
       fireball1.alpha = .3;
    if (herobar.width >= 80){
    herobar.width = 80}
    score.text = String(points);
    if (score.text < "0" ){
    score.text = "0";
    if (points< 0){
    points = 0;

  • Horizontal Scrolls on the  main Stage

    Hi
    I am putting 11 movies containing 11 flv files on my main
    stage. All those movies have onMouse over and click events attached
    with them. As those movies are not going to fit on the main stage
    so when i am running the flash file, it is just displaying 5 of the
    11 movies and rest are being cut. Is there any way that I can code
    so that I will get the horizontal scrolls automatically if the
    movies are not going to fit on the screen? I am new to the 'stage'
    and AS3 concepts . Please help me out.
    All I need is to put 11 movies on the main stage with the
    horizontal scrolls.
    Thanks in advance for your help
    regards
    Anuj

    you can check a similar thread involving a scrolling
    movieclip:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=665&threadid =1324923&enterthread=y

  • How to load different html files in one page in order to load them without leaving the main stage?

    Hello,
    I'm new with edge animate, but i fell in love with it.
    I'd like to know, is it possible to load different html pages dynamically in the main stage in order to avoid the preloader to be load?
    I can figure out how to save all the pages of the site, but i can't merge them in a continuous animated browsing experience.
    As sample.
    I've got a index.html and home.html, how to switch form index to home without having a clear division between the two pages?
    I can place all the animations within a file and this will allow me to have a continuous surfing experience but it won't generate specific and google indexable pages within the site.
    Example, index.html will generate www.mysite.com, home will generate www.mysite.com/home. How ho switch dinamically between them and integrate them in a unique fading experience?
    Thanks in advance for any help. I'm a newby, but i would like to learn.
    Fea.

    Look into using the Loader class to load the swf files.  If you want to have it happen in different frames then you can put the code into the different frames.

  • Making the main stage timeline play in reverse.

    Hey all thanks for looking. I figured out how to do this with movie clips but I can't seem to get it right with the main stage. Can anyone tell me a simple methood of telling the stage to continue playing in reverse, after a button is clicked, until it reaches a keyframe that will tell it to stop? I'm trying to make it so buttons will tell the stage to play a transition from beginning to end and then have it play in reverse when the "back" button is pressed. I'm currently searching online to find an answer but I haven't had any luck yet. Thanks for the help!

    KgIad -- tried to use this code but I am getting
    TypeError: Error #2007: Parameter listener must be non-null.
    Which appears to be caused by the changeTimelineF not being recognized. If I create it as
    private function changeTimelineF(e:Event) {
    if(startFrame<endFrame){
                e.currentTarget.mc.nextFrame();
            } else {
                e.currentTarget.mc.prevFrame();
            if(e.currentTarget.mc.currentFrame==e.currentTarget.endFrame){
                e.currentTarget.removeEventListener(Event.ENTER_FRAME,changeTimelineF);
    Then it is recognized--but the variables (e.g. startFrame and endFrame) are no longer valid.
    What am I missing?
    Thanks
    Mike

  • Attach a movieclip from the main timeline inside another movieclip.

    I need help with the game I am working currently. On the main timeline Actions frame I have a loader class called myLoader. I attached that to a movieclip called currentSWF. I have a movieclip called SpinningCard in the library which I dynamically attached to the stage. Inside the SpinningCard movieclip there is another movieclip Card. In the Card movieclip I have 10 frames and on each frame I want to attach a different instance of the movieclip currentSWF. How can I do achieve that?
    here's what I have till now...
    On the main timeline Actions frame...
    var loader:Loader=new Loader();
    loader.load(new URLRequest("CardGraphics.swf"))
    var currentSWF:MovieClip;
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoaded);
       function swfLoaded(e:Event):void {
       currentSWF = MovieClip(loader.contentLoaderInfo.content);
       addChild(currentSWF);
    Inside the Card movieclip on the first frame I have this code...
    var a1:MovieClip = MovieClip(parent.parent.getChildByName('currentSWF'));
    CardFrame1.addChild(a1);
    //CardFrame1 is an empty movieclip which is there on the frame 1 of Card Moveiclip.
    I am getting error : Parameter must be non-null. How can I solve. Can anyone please help me.

    Hi Nabren
    I'm also looking to load a library based movie-clip into a stage based movie-clip, so that I can inturn swap it with other movie clips to act as different pages (page2_mc etc) which will be used in different sections of the application to give chapters as such.
    I've had a go at the above but can't get a result, though it did not throw an error. I also had a trace() on each side and both of those triggered.
    The stage based mc I called pageMC and the content mc I called content the same as your example
    trace('loader - cx');
    var loader:Loader=new Loader();
    var pageMC:MovieClip;
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoaded);
    function swfLoaded(e:Event):void {
    pageMC = MovieClip(loader.contentLoaderInfo.content);
    pageMC.name = "pageMC";
    addChild(pageMC);
    trace("Menu 4");
    I'd appreciate some assistance. I would like to use internal MC's as I want to put the application to iOS and Android and believe by using movieclips I should be able to have some code with them whereas importing swf's I can't.
    Thanks

  • After changing a subreport I loose data in the main report.

    Hi All,
    I have a main report that has two parameter fields and two subreports linked to the parameter fields.  The two subreports access the database and work fine separately.  When I add the two subreports to the main report it works fine.  As soon as I make a change to a subreport it works fine standalone.  But as soon as I update the main report (reimport subreport) the subreport no longer returns data to the main report.  To get the report to work after a change to a subreport I have to delete the subreport from main and then add it back in again.
    Does anyone have any suggestions?
    I am using Crystal Reports 10 and I'm totally at my wits end.  I've been working with Crystal for about 5 years and this is the first time I've seen this.  Maybe I'm missing something small but I just can't seem to find the answer.
    Thanks for any help,
    Jim

    Jim:
    I usually edit my subreports from within the main report.  I right click the subreport and then click edit subreport.  This eliminates the need to reimport the subreport.  I've done a lot of work with subreports and this always works for me.
    I hope this is not too late and helps you out.
    Ralph

  • Subreports won't show when put inside a tablix in the main report

    I have a main report containing 5 subreports. My ultimate goal is to have a header with an image in it to only show within 2 of the subreports. I'm trying to achieve this by using a tablix and putting all of my subreports into the tablix on the main report,
    and putting the image into the header of the tablix and using a hide/show query based on subreport name.
    The problem is that when I put the subreports into the tablix and upload it to CRM it won't display at all. If I remove the tablix the subreports will run and display perfectly. Can anyone tell me what I'm missing here or an alternative if there is an easier
    way to achieve what I want? 
    Thanks.

    Hi Ssizz,
    Per my understanding your are experiencing the issue with the subreport which added to the tablix not displayed after upload to the CRM, right?
    I have tested on my local environment and try to reproduce your issue but failed.
    The issue can be caused by many factors, could you please try to provided us more details information according to questions below, and we will be more effective to give an solution:
    Did the issue occurred only when your upload the main report to CRM, and Is there any error message,such as "Subreport Could Not Be shown"?
    Did you run to check all the subreports and the main report which include the tablix with the 5 subreports in both the designer and the CRM one by one? Did they all running with no error?
    Did you have add any parameters in the subreport and the main report, if did, please check if all the parameters work fine in the designer.
    You have mentioned that when you remove the tablix, the subreports will run perfectly, Is that mean you put the subreport outside the tablix and have a test then all works fine? in the designer or in the CRM? 
    Please also take reference to the solution of some possible factors:
    1. If you got the error "Subreport Could Not Be shown" only in the CRM and all works fine in the designer, the issue can be caused by the relationship between parent report and sub report got disturbed and CRM doesn't able to link these sub reports.
    From Reports section select the sub report and click on edit
    Remove the value in Parent Report look up field
    Map Parent Report again
    Re-publish the reports. Below steps will help us in publishing the reports again
    Open command prompt on CRM application server
    Go to Microsoft Dynamics CRM\Tools folder
    PublishReports.exe NameOfYourOrg
    Ex: C:\Program Files\Microsoft Dynamics CRM\Tools\PublishReports.exe mytestcrm
    If the above setting still doesn't work, please try to delete both the subreport and main report in CRM and try to upload once again, If it possible, please first redesign the main report in designer.
    Similar thread for your reference:
    http://blog.customereffective.com/blog/2008/07/resolving-error.html
    https://social.msdn.microsoft.com/Forums/en-US/60542d2e-c888-442f-9b8a-5ed779f7e3d9/crm-reports- error-subreport-could-not-be-shown?forum=crm
    Article about details setting with main report and subreport in CRM:
    http://dynamicscrmgirl.wordpress.com/2014/06/29/crm-2013-ssrs-report-and-sub-reports/
    2.  Another alternative method is using an rectangle instead of the tablix to put the subreports, you can use  this to see if the problem still exists.
    Any problem, please feel free to ask.
    Regards
    Vicky Liu

Maybe you are looking for