Button on main stage target frame in mc

This seems simple, but for some reason it is not working.
I have a button on the main stage. I want to target my MC
(McSlidey01) that is placed on the main stage.
facts:
McSlidey01 is a MC that is 50 frames long. On the last frame
it has an action script that takes it back to the root and advances
to the nextFrame.
button01 is on the main stage. I want this button to stop
McSlidey01 on frame 25. This way it will stop the MC and not
advance to its last frame that has the nextFrame action on
it.

:

Similar Messages

  • Accessing buttons on main stage from inside of a movie clip

    Greetings...
          here is the scenario:
                 - I have buttons on main stage, and a swf file which is loaded to scene using a LOADER in AS3
                 - this is a website, so the problem rises when user moves its cursor around the page and now  buttons in main stage,
                    are still active since they are behind the loaded swf file.
                 - i would like to learn, how can i CODE inside the loaded SWF file, to either remove the buttons in main page, or remove
                    the event listeners. not sure if my case has anything to do with .Parent or .roo, (I want to access those main stage
                    buttons from the SWF file which is loaded)
                 - The general case is, i have SWF files loading inside another SWF files, is it possible to access items on each stage from
                    inside of loaded SWF files on that specific stage. Similarly i would be interested to learn about accessing main stage from inside
                    of movieclips running on stage. how can i access something not in present FLA file yet, in FLA file that is loading the page as SWF.
                    Thanks.

    If you load an swf into another using the Loader class, then the Loader itself is the parent of the loaded swf., so MovieClip(parent.parent) might help you to target the timeline that the Loader was born from.  The more proper way to have a loaded file talk to a parent file is thru dispatching events that the parent assigns listeners for after the file has loaded.  Here's a link to a posting that might help explain how to implement this.
    http://forums.adobe.com/thread/470135?tstart=120
    As for the buttons that you want to disable, you could either use the removeEventListener() method to remove the listeners you have assigned, or you could set their mouseEnabled property to false, or you could set their visible property to false.

  • Referencing a button on main stage from inside a movieclip

    I am banging my head against the wall on this.
    On the main stage I have a button that I have made invisible once the file is loaded.  Inside a movieclip I have on frame 15 the following actionscript 3 code
    button_mc.visible = true;
    I want the button to become visible at the end of this movieclip.  I am not using an external as3 file, I am putting the as3 code in its own layer on the first frame.
    I know it has something to do with the path to the button, but I cannot figure it out.  If there is anyone who can point me in the right direction for referencing instances by instance name that reside on the main satge from inside a movieclip I would be very grateful.
    Thanks
    Thepopguy

    Try:
    MovieClip(this.parent).button_mc.visible = true;

  • Buttons null; losing stage instance names

    Hello, I apologize if this question has already been asked but as the title states I'm having problems with the instance names of my buttons. I am using Actionscript 3 with Flash CS5. I apologize in advance for being verbose but it'd be best if I explained my problem in detail.
    I have my project set up so that everything occurs in one MovieClip and buttons within the MovieClip are clicked to navigate through the MovieClip. The MovieClip contains several frames which are all unique and contain a variety of textboxes, MovieClips, buttons, classes and other custom classes. All of these components are created directly in Flash Professional by dragging them from the library onto the stage inside of the MovieClip.
    I then name these components using Flash Professional and use these instance names to work with the components. Usually this works without a problem. However, now that I am using a nested MovieClip for my project many problems are occuring. I have it so that when buttons are clicked, the MovieClip goes to a certain frame via the gotoAndStop(x); command. This works fine but I am having problems accessing the buttons that I have named earlier. It gives a null object reference error and when I trace the button it traces as "null".
    Originally I thought that this problem was because the MovieClip had not yet initialized but I had used the ADDED and RENDER event listeners, Timeline scripting, and other methods but the button was still null, leading me to believe that the problem was more than that.
    So I used a click event listener that traced the instance names of the components that I was clicking (trace(e.target.name)). I have a total of 8 buttons on the specific frame of my MovieClip so I clicked on them all. 6/8 of the buttons traced the correct instance name that I had given them whereas the other two buttons traced "instance 169" and "instance 177" instead of the instance name.
    With all this strangeness, I commented out the code for these 2 specific buttons to see if it would work without them. Sure enough it did.
    I believe that my buttons have lost their stage instance names and I do not know how to fix this problem. I have tried deleting the buttons and creating them again but to no avail. It does work, however, if I use the Button component that Flash has but I do not want to do that because I'd like to use my own custom buttons (I know the Button component is customizeable, but I'd like to use my own anyways).
    If anyone could help, please how can I fix this problem? If my .fla or specific code needs to be provided, I can do so.

    Without looking at your code I can't say 100% what is going on. However, I suspect what is happening is that you're doing the following:
    Your button is on stage in frame 1
    You add an event listener to that button
    At some point, you go to a frame where the button does not exist.
    When you come back to frame 1, your listener doesn't work anymore
    Or some variation of above, where an instance was on the stage, is removed, and even though it appears to have been added back you can't reference it anymore.  I've discussed fixes for this issue in depth in this article, but it all boils down to the fact that when the object is removed from the stage the variable that contained the instance the first time will go to null, and then when you go back to the frame with the instance on it, the variable will be populated with an instance which is probably not the same as the first one.
    If the problem is what Ned Murphy speculated, you can easily fix it by setting mouseChildren to false on the buttons.

  • How to access frame lable on main stage from a nested symbol

    All-
    I have two buttons
    btnA on the main stage
    btnB is nested inside btnA
    How do I access a frame lable on the main stage from btnB

    ok i figured this one out.
    i created a button symbol 'BTN-NAV-INTRO' and placed it on the main stage.
    i created a mouse over/out effect on it's timeline with an object on top called 'MC-HIT-AREA' 
    i placed the mouse over graphics inside the button and animated them on their own timelines
    coded the MC-HIT-AREA to play those timelines 'MC-HIT-AREA' is nested inside the button
    then on the main stage (this is what threw me) i set the button ('BTN-NAV-INTRO') to cursor and coded it to call the other button form the main stage.  Nesting it wasn't necessary.  I didn't realize you could have multiple mouse over/out effect below a mouse over effect from the main stage
    Edge rocks when i get it to do my bidding! 

  • 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

  • Can't target main stage from dynamically loaded swf...

    A part of the Flash app. I'm working on right now does the following -
    Main stage loads an external swf using the following function:
    function loadAsset(evt:String):void{
    var assetName:String = evt;
    if (assetName != null){
      var assetLdr:Loader = new Loader(); 
      var assetURL:String = assetName; 
      var assetURLReq:URLRequest = new URLRequest(assetURL); 
      assetLdr.load(assetURLReq); 
      assetLdr.contentLoaderInfo.addEventListener( Event.INIT , loaded) 
      assetLdr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, displayAssetLoaderProgress);  
      function loaded(event:Event):void { 
       var targetLoader:Loader = Loader(event.target.loader); 
       assetWindow.addChild(targetLoader);
    The externally loaded swf loads another external swf into itself using the following function:
    function loadQuiz(evt:String):void{   
    var quizName:String = evt;
    if (quizName != null){
      var quizLdr:Loader = new Loader();
      var quizURL:String = quizName;
      var quizURLReq:URLRequest = new URLRequest(quizURL);
      quizLdr.load(quizURLReq);
      quizLdr.contentLoaderInfo.addEventListener( Event.INIT , loaded)       
      quizLdr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, displayQuizLoaderProgress); 
      function loaded(event:Event):void {
       var targetLoader:Loader = Loader(event.target.loader);
       quizWindow.assetLoader.addChild(targetLoader);     
    Everything loads fine, but from the quizWindow.assetLoader.addChild(targetLoader) level, I want to send a message/fill in a dynamic text box on the Main Stage. I have been "parenting" my brains out and I'm not sure how to communicate with that level.
    can anyone show me the proper path or method based off the above, or have a suggestion?
    Cheers,
    ~Chipleh

    Andrei1,
    Thanks again for your help. I was finally able to get the solution you posted below to work for me.
    Much appreciation,
    ~Chipleh
    "In your loaded movie write:
    function traceMyself(e:MouseEvent):void{
         dispatchEvent(new Event("I_WANT_TEXT"));
    function writeText(text:String):void {
         xmlFileName1.text = text;
    In the top movie that loads external swfs something like that:
    loadedSwf.addEventListener("I_WANT_TEXT", onTextRequest, true);
    function onTextRequest(e:Event):void {
         Object(e.target).writeText(tQuizXmlFile1.theQuizXmlFile.text);
    This way these two entities are independent and, most importantly, don't care who is the parent or grandparent."

  • Buttons to Target Frames in MX

    having trouble getting buttons to target certain frames in
    flash MX.
    I basically have a menu bar, and I am trying to get each
    button to target a specific frame in my timeline and also STOP at
    that point.
    That way when a visitor comes to the site they can access all
    the information without the movie playing everything at once.
    EXAMPLE:
    My movie stops at from 20. Button1 on frame 20 should target
    frame 21. (once properly coded, I can handle the rest to get it to
    stop at let's say frame 30)
    Button 2 (on frame 20) should target frame 31, and so on and
    so on.
    All references I have been researching have been either old
    versions of flash, etc, etc. and you know how that goes.
    Thanks in advance!!!!

    Best advice, don't use Frames.   Server-Side Includes and DW Templates will help you maintain consistent looking web pages without Frames.
    SSI's
    http://www.smartwebby.com/web_site_design/server_side_includes.asp
    DW Templates (.dwt file)
    http://www.smartwebby.com/web_site_design/dreamweaver_template.asp
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • Button item's target frame property creates a problem

    Hi All
    I have created a button in one page.set its destination property and set target frame property to _blank
    When i run this page in jdeveloper,it works fine.
    when i deploy that page in Client's env,it says that _blank is undefined.
    Is there any parameters we have to set it to enable target frame property.
    Is there any other way to open a page in another window?
    Any pointers will help me a lot.
    Thanks
    Hitesh

    I am facing the same problem. Any solution ??

  • 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.

  • Draging a box with button attached on stage excuting button problem

    Hi,
    I have a box on the stage, which is a movie clip. I opened
    this movie clip and placed a button on it. I want to be able to
    drag the box on the stage and the button to move with it. Also I
    want to be able to press the button , which take me to frame 2. I
    have done all of this but the button will not activate. The code I
    have written is:
    box_mc.onPress =function(){
    startDrag(this);}
    box_mc.onRelease=function(){
    stopDrag()};
    stop();
    I opened the movie box (where i placed the button) I wrote
    the following code:
    gotoframe2_btn.onRelease=function(){
    gotoAndStop(2)};
    However, I can drag the map (with button attached) but cannot
    press the button, to perform the action, to bring me to Frame 2. I
    have created a 2nd Frame in the Timeline on the main stage and also
    on the Timeline when i open the movie of the box.
    Hope you can help
    Thanks
    Paul

    Oh, sorry about that, I didn't see the code you posted in the
    previous topic I made
    but thanks a lot i got it working!

  • Assistance unloading flv's from swf's imported to main stage

    I have my main.fla which imports external swfs that contain flv's. I have three buttons that navigate the main timeline to frames 2-4. At frames 2-4 an external swf gets loaded into an empty movie clip via this code. Each loaded swf acts like a menu with some nice vidoes loading in the background.
    The problem i found is the flvs continue to play as i navigate between menus, which makes the main swf/fla slow down becuase the pc is working harder to deliver all the stuff running in the background. I've added this code to frame 1 of my empty movie clip that is in my library that has the instance name 'menu1'
    I keep getting the error "Access of undefines property mc1"
    I have the source files for my site here if you can take a look and see what I'm doing wrong. I have removed this code so i don't get the error and have tried other things to no avial.
    http://www.coldbloodedsovereignty.com/site.zip
    var loader:Loader = new Loader();
    addChild(loader);
    loader.load(new URLRequest(MovieClip(this.parent).src));
    var src:String="external.swf";
    menu1.addEventListener(Event.REMOVED_FROM_STAGE,f);
    function f(e:Event):void{
    MovieClip(e.target).loader.unloadAndStop();

    consider the files gifts to those willing to help, should they choose to use them for their own. oops, yes the files were created in cs5.
    I will try your suggestions tonight. Thank you.

  • 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.

  • Rollover event not playing movie in buttons/gotoandPlay function not playing frames

    This web site has 7 buttons (each button plays a different movie/each movie(.flv) has a stop action at frame 1). The first 3 buttons (button set 1) exist on the timeline from frames 1 to 28. Frame 29 has a blank key frame for the 1st 3 buttons. There is action script for the 3 buttons in frame 1. Next 4 buttons (button set 2) exist on the timeline from frame 30 to 90 as well action script.
    The stop actions are at frames 29,50,69,90. Labels are at frames 1,30,51,70. When testing the movie button set 1 functions as expected (the rollover event for each button plays its movie and selecting the button plays the correct frame) . Button set 2 is not working (the rollover event for each button is not playing the movie and selecting the button does not play the frame)
    Using cs4, as3
    This is my 1st attempt at an interactive project like this and am not sure how to make all the pieces work together. My action script is included below. I would appreciate a breakdown of why the movies are not playing as well as the gotoandPlay function for button set 2 and how can this be fixed. No errors are reported when I test the movie the buttons for button set 2 just do not function.
    Thanks in advance.
    AS frame1:
    import caurina.transitions.*;
    import caurina.transitions.properties.*;
    DisplayShortcuts.init();
    conbut.addEventListener(MouseEvent.ROLL_OVER, conbut_ROLLOVER);
    function conbut_ROLLOVER(e:MouseEvent):void
        Tweener.addTween(contact_1, {_frame:10, time:0.2, transition:"linear"});
        var over:Over = new Over();
        over.play();
    conbut.addEventListener(MouseEvent.ROLL_OUT, conbut_ROLLOUT);
    function conbut_ROLLOUT(e:MouseEvent):void
        Tweener.addTween(contact_1, {_frame:0, time:0.5, transition:"linear"});
    newxbut.addEventListener(MouseEvent.ROLL_OVER, newxbut_ROLLOVER);
    function newxbut_ROLLOVER(e:MouseEvent):void
        Tweener.addTween(newsx, {_frame:10, time:0.2, transition:"linear"});
        var over:Over = new Over();
        over.play();
    newxbut.addEventListener(MouseEvent.ROLL_OUT, newxbut_ROLLOUT);
    function newxbut_ROLLOUT(e:MouseEvent):void
        Tweener.addTween(newsx, {_frame:0, time:0.5, transition:"linear"});
    gall.addEventListener(MouseEvent.ROLL_OVER, gall_ROLLOVER);
    function gall_ROLLOVER(e:MouseEvent):void
        Tweener.addTween(gal, {_frame:10, time:0.2, transition:"linear"});
        var over:Over = new Over();
        over.play();
    gall.addEventListener(MouseEvent.ROLL_OUT, gall_ROLLOUT);
    function gall_ROLLOUT(e:MouseEvent):void
        Tweener.addTween(gal, {_frame:0, time:0.5, transition:"linear"});
    function spineasel_top_mc() {
        easel_top_mc.play();
    newxbut.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_15);
    function fl_ClickToGoToAndPlayFromFrame_15(event:MouseEvent):void
        gotoAndPlay("news..");
    gall.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_9);
    function fl_ClickToGoToAndPlayFromFrame_9(event:MouseEvent):void
        gotoAndPlay("gallery..");
    conbut.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_10);
    function fl_ClickToGoToAndPlayFromFrame_10(event:MouseEvent):void
        gotoAndPlay("contact..");
    AS frame30:
    import caurina.transitions.*;
    import caurina.transitions.properties.*;
    DisplayShortcuts.init();
    inv_gallery_btn.addEventListener(MouseEvent.ROLL_OVER, inv_gallery_btn_ROLLOVER);
    function inv_gallery_btn_ROLLOVER(e:MouseEvent):void
        Tweener.addTween(gallery1a, {_frame:16, time:0.2, transition:"linear"});   
    inv_gallery_btn.addEventListener(MouseEvent.ROLL_OUT, inv_gallery_btn_ROLLOUT);
    function inv_gallery_btn_ROLLOUT(e:MouseEvent):void
        Tweener.addTween(gallery1a, {_frame:0, time:0.5, transition:"linear"});
    home_1.addEventListener(MouseEvent.ROLL_OVER, home_1_ROLLOVER);
    function home_1_ROLLOVER(e:MouseEvent):void
        Tweener.addTween(home, {_frame:16, time:0.2, transition:"linear"});
    home_1.addEventListener(MouseEvent.ROLL_OUT, home_1_ROLLOUT);
    function home_1_ROLLOUT(e:MouseEvent):void
        Tweener.addTween(home, {_frame:0, time:0.5, transition:"linear"});
    inv_news_btn.addEventListener(MouseEvent.ROLL_OVER, inv_news_btn_ROLLOVER);
    function inv_news_btn_ROLLOVER(e:MouseEvent):void
        Tweener.addTween(news_1a, {_frame:16, time:0.2, transition:"linear"});
    inv_news_btn.addEventListener(MouseEvent.ROLL_OUT, inv_news_btn_ROLLOUT);
    function inv_news_btn_ROLLOUT(e:MouseEvent):void
        Tweener.addTween(news_1a, {_frame:0, time:0.5, transition:"linear"});
    contact_1a_inv.addEventListener(MouseEvent.ROLL_OVER, contact_1a_inv_ROLLOVER);
    function contact_1a_inv_ROLLOVER(e:MouseEvent):void
        Tweener.addTween(contact1, {_frame:16, time:0.2, transition:"linear"});
    contact_1a_inv.addEventListener(MouseEvent.ROLL_OUT, contact_1a_inv_ROLLOUT);
    function contact_1a_inv_ROLLOUT(e:MouseEvent):void
        Tweener.addTween(contact1, {_frame:0, time:0.5, transition:"linear"});
    inv_news_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_20);
    function fl_ClickToGoToAndPlayFromFrame_20(event:MouseEvent):void
        gotoAndPlay("news..");
    inv_gallery_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_21);
    function fl_ClickToGoToAndPlayFromFrame_21(event:MouseEvent):void
        gotoAndPlay("gallery..");
    contact_1a_inv.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_22);
    function fl_ClickToGoToAndPlayFromFrame_22(event:MouseEvent):void
        gotoAndPlay("contact..");
    home_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_23);
    function fl_ClickToGoToAndPlayFromFrame_23(event:MouseEvent):void
        gotoAndPlay("home..");

    Steps tried so far to troubleshoot functionality of buttons in 2nd set:
    -         Recreated the .flvs for all buttons in 2nd set. Re-imported to flash and swapped with existing video
    -         Thru event generator generated rollover and rollout code for each button
    -         Commented out the stop action for each video (stop actions remained active on main timeline on stage)
    -         Retested movie – video continuously looped on all buttons in 2nd set, GoToAndPlay function still not working
    -         In addition to the commented out stop actions for each video also commented out stop actions on main timeline for buttons in 2nd set
    -         Retested movie – Rollover functionality which causes the video to play works; GoToAndPlay function plays the correct frame but continues to play through to end of timeline

  • 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.

Maybe you are looking for

  • Album view in iTunes 11.1.5.5

    Sorry if this is a 'noob' type question ... I used to have views of albums in the Music folder.  Something has happened to iTunes and now all that I get is a list (organised by album name), Have tried various things and nothing gets me back to the vi

  • How to open selected files from a listbox

    I am trying to open files from selected items in a listbox, but am having some problems. Here is my code: var firstLibrary = "C:\\Program Files (x86)\\Adobe\\test\\Library1.indl"; var secondLibrary = "C:\\Program Files (x86)\\Adobe\\test\\Library2.in

  • Application errors occured in ccBPM not restartable?

    hello experts, We are using ccBPM for some of the integration scenarios and synchronously posting data to SAP R/3. When an BAPI returns an application error code (e.g. material locked by an user), we are unable to restart these messages from SXMB_MON

  • AppWorx with Oracle EBS

    Has anyone used AppWorx with EBS to schedule jobs, etc? I searched on google and there isn't much to be found. Why use App Worx when Concurrent manager is available to schedule jobs? What are the advantages? How is AppWorx integrated with EBS? Can co

  • Report Server Integration Feature is missing

    Report Server Integration Feature is missing in site collection feature lists, so, i cannot activate it to get the SQL Server Reporting Services Content Types. No sure if it is related with a recent PU and CU patching. checked http://msdn.microsoft.c