EventListener for a clip within a clip

I'm kinda a noob actionscript so sorry if this is a stupid question and to be honest, there is a big part of me who wants to try and understand it, but I would like any advice or pointers.

What I'm trying to do is set up a grid of 4 x 5 boxes.  Inside each box are 1) using the arrow keys image 2) four 3) a text field to enter the code for the image.  The idea is that someone might enter product in each text field codes and be able to record this information in an external xml file.  If they wanted to change the order, but keep a picture, they could just use the arrow keys to move the product around the grid.


When I run problems, it is that I can put the boxes up on the screen in a grid.  I can give an instance name to each box.  But I have not yet discovered a way to address a clip (for example one of the arrow buttons) which is a child of the original movieclip place by my curls.  Ideally, I'm looking to find a way, target values and change:

Box1-> up arrow

Arrow pointing down

Left arrow

Right arrow key

Image

Text box

Box2-> up arrow

Arrow pointing down

Left arrow

Right arrow key

Image

Text box

But I'd be just as happy if I could just give each button an instance name, and then respond like that.

Here's my class until now:

package {}
import flash.display.MovieClip;
import flash.events.MouseEvent;
Import Card_mc;
Import Up_Button_mc;

public class place_cards extends MovieClip {}
private var _card:Card_mc;
private var _up_button_mc:Up_Button_mc;

private var _cardX:Number;
private var _cardY:Number;
private var _card_counter:Number;
private var current_target: *;

public void place_cards() {}
createCards();
}


private function createCards (): void {}
This function places the initial cards on the screen

_card_counter = 0;
_cardY = 25;
for (var j: Number = 0; j < 5; j ++) {}
_cardX = 25;

for (var i: Number = 0; i < 4; i ++) {}
_card_counter += 1;
_card = new Card_mc();
addChild (_card);

_card.x = _cardX;
_card.y = _cardY;
_cardX += _card.width + 20;
_card. Name = "Card_mc" + _card_counter;
_card.addEventListener (MouseEvent.CLICK, OnClick);
_up_button_mc.addEventListener (MouseEvent.CLICK, DirectionClick);
}
_cardY += _card.height + 20;
}
}

private void OnClick(event:MouseEvent):void {}

Debug subroutine to see if my card names correct
trace (Event.Target.Name);
}
private void DirectionClick(event:MouseEvent):void {}

Check if the arrow keys were clicked.

If they have, perform actions.

Consider using a new class for behaviors.


trace ("direction click:" + event.target.name);
}
}
}

There is almost always a way with flash.  but I still don't know what you are looking for.  possibly:

var will tell: Array = ["up", "down", "left", "right"];

for (var i: uint = 0; i<>

_card ["_" + say [i] + "_button_mc"] .addEventListener (...);

}

Tags: Adobe Animate

Similar Questions

  • Apple "final cut pro 7", high res Pro 422lt 1920 x 1080 (odd) clips, is this gradual?, no 1080 progressive setting sequence, how can I ensure that I have the best setting of the timeline for my clips

    Apple "final cut pro 7", high res Pro 422lt 1920 x 1080 (odd) clips, is this gradual?, no sequence definition 1080 progressive

    How can I make sure that I have the best setting of the timeline for my clips. I did all the settings of Mount clips but there is no progressive setting for 1080 p. Images originally dslr Nikon that I used mpeg streamclip to convert to prores. Thanks for your help!

    The frame for you size source of material is HDTV 1080i (16:9). That only sets the size of the image, not the domination of the field, it's what makes progressive or interlaced. The reason it's labels with the 'i' is that when FCP7 was abandoned by Apple, they have never updated the software in order to take account of 1080 p contents.

    To make your progressive sequence, set the dominant field to None.

    gerforce wrote:

    Images originally dslr Nikon that I used mpeg streamclip to convert to prores.

    In your screenshot of the properties of the element for your clip to the source, the material is interlaced. At the original camera file interlaced or progressive?

    Also, the fps footage was actually 30 original and 29.97 not standard?  30 images/s is very limited its use.

    MtD

  • Sometime this week, my MacBook Pro has lost its sound. I can't listen to anything that has the sound of iTunes for video clips. It is no longer a Volume icon (speaker w / lines of radiation) on my Menu bar

    Sometime this week, my MacBook Pro has lost its sound. I can't listen to anything that has the sound of iTunes for video clips. It is no longer a Volume icon (speaker w / lines of radiation) on my Menu bar. My MacBook Pro is a mid-2012, 2.3 GHz Intel Core i7 Memory 16 GB 1600 MHz DDR3 OS X Version Yosemite 10.10.5

    Graphics Intel HD 4000. Can anyone help?

    Thank you very much!

    Thai-Anh

    Reset NVRAM may solve it.

    How to reset the NVRAM on your Mac - Apple Support

    Or system preferences > sound, check on 'Volume to see the menu bar' to show the volume of the sound in the menu bar.

  • Charger for the Clip +.

    Hello

    I have a charger for my car navigation system. It is said: + 5V 1000ma Max. It would be OK to use for the Clip +?

    T.I.A.

    Thank you!

  • using a mac for sansa clip +.

    If anyone can help I would really appreciate it. I use a mac powerbook g4 to download songs on my clip +.  I changed the song in MP3 format. My clip + recognizes the songs I load, but for some reason, it adds a second copy of each song that is a fraction of a second of time. No matter what I try, I can't seem to load without these blasted second copies.

    I found a way around the. second _ copy.  It was another thread for the clip.  There is a program for mac called kopymac that can be downloaded for free on www.macupdate.com.  This action solved the problem completely.  Thanks for the help.

  • I'm looking for video clips that I can use to open and close my video with a third lower, y at - it a link to download these templates?

    I was looking for video clips on the theme, like a clip that opens and closes my video and with the lower thirds

    the lower third models are here, if that's what you're looking for?  Library, title, missing model projects templates: Premiere Pro, After Effects, yet

  • Missing media for 17 clips when I opened a project.

    I am a new user. I use Classroom In A Book as my tutorial. When I opened a project, I am missing the media for 17 clips. Nothing I've tried find them.

    Yes, you will need to link to the lesson. You can do this by clicking with the right button on the files in the location of the project and select "Link Media"

    Thank you

    Regalo

  • How to change the time of departure for the clips in the properties?

    Hello there ,.
    I have tested the Audition CS5 right now and he find much except for one thing:

    In the properties for each clip, there is a departure time. But it can not simply be edited!

    I can change the start time of the entire session - Yes.

    But not those of individual clips. Only by moving around and is not very accurate.

    Is there a a way to change this from time for clips by typing in numbers?

    Thank you :).

    It seems to me that this feature has been removed...

    Pourrait this really true? !!

    Please help someone.

  • On the research of the compression settings good for send clips

    Hi all

    I want an easy way to send something I usually work no matter what, up to 60 seconds.

    Some settings of copy editing using wizards to send customers here is that I have:

    Target for the size of the end of the clip to be close to, but not more than 5MB.

    Use the Sor 3 426 x 240 (for 16:9)

    22,050 16-bit mono audio

    I thought I could use these settings for all the clips, then I could limit the size of different lengths by changing the data rate.

    I thought that if I divide 5000 the number of seconds of the clip he would give me a K/sec data rate, which would then keep the size about 5 MB.

    I was wondering if I have all this right? or if anyone has any other advice?

    Do some testing, I found 60 sec @85 K/sec gave 4.9 MB which sounds right.

    But 60 sec @ 250 K/s has given 8.3 MB which is less than I thought. (edition assistants say they often use 250 K/sec for 60 s and get 5MB!)

    Can someone explain this to me?

    As I say, the whole point of this is to able to quickly work settings allowing to produce QT.

    Cheers

    Forget it... I know that sounds harsh, but it's the only honest answer. CoDecs that use their share variable bitrate, time variable extends on and several levels of spatial compression are literally mathematically unpredictable - you do not know the result until you have run the clip through the algorithm. The effective data rate depends on too much of the content of the image. That is why in the encoders, we always call him 'target bitrate' exit not final bitrate. Only CoDecs that use fixed matrices, at regular intervals and clearly structured video compression algorithms can be calculated as MPEG-2 and H.264, but still there is always a minor variability and uncertainty. It may not be practical, but test the settings for each clip is about the only way, if you need to reach a file size. As a general rule, you can base your rough estimates of the lower third to size / data rate, i.e. If you need 5 MB files, target your settings to 3.5 MB.

    Mylenium

  • Why use ins and out of the points for the clips?

    Hello

    I use PPCS3 and never understood the need for the ins and points for the clips.

    Always just, I took my clip (no matter how long or short) and he parried on the chronology of the sequence.

    Is this just another method or y at - it something I'm completely missing when it comes to the ins and outs?

    I guess it depends on what you are used to doing.

    Any guidance here on where the ins and outs made a big difference would be appreciated.

    Thank you

    Simon

    Simon,

    You are using and the Points on the instances of your footage on the Timeline. You're just doing it on the timeline, instead of in the Source monitor. It's a matter of how you want to work. PrPro offers many ways to do different operations. We could also use the monitor fitting to do this, if that's how they want to.

    Good luck and we hope this helps,

    Hunt

  • removeMovieClip for several clips with attachMovie

    Hello
    I have several MC created using attachMovie. I'm not all the deleted, only is removed. How can I get all the deleted?
    My code is:

    Thank you
    Paul

    You gave to every instance of the same instance name. When you go to remove the clips, Flash will only find the first element with that name and remove it. Use unique names for each clip, and then use the same names to remove.

  • limit for video clips following the mouse

    Here's my ACE...

    myInterval = setInterval(KBMOglobal,15);

    function KBMOglobal () {}
    KBMOglobal1._x = (KBMOglobal1._x - _xmouse) / 10;
    KBMOglobal1._y = (KBMOglobal1._y - _ymouse) / 10-2;
    }

    OK, so my video clip follows the mouse around, with a slight delay and the y axis is slightly lowered. the scene of my film is 380 x 640. someone has suggestions on how to create a border, equal to the size of my stage, which leaves no film clips that follow the mouse to extend to the beyond? Does still make sense? Basically, I'd like to as video clips to follow the mouse, the stay of entire film visible on the scene clip. due to the positioning of elements on the stage which initiates this function, I must only consider the width of each clip, which fortunately is a constant = 200. Does this make any sense? Let me try this one more time...

    How to set the above function for the clip, KBMOglobal1 (which has a width of 200) remain in the horizontal limits of the scene (which is 380)?

    Thank you for your time and all members of this forum who was very helpful with all my questions in this project so far, yall rock!

    Quote:
    Posted by: NickTheNameless
    It's almost works perfectly, however I need to adjust the limit of axis x. for some reason, the video stops after the mouse when it comes to halfway on scene, horizontally.

    could you please be so kind as to explain what your script is doing? because I'm not a fool, I realize that I could probably replace 380 to 760 (double the width of the scene) and it works as expected. However, if you could spare the time to explain what the following two lines do, step by step... I'll give you my first born...

    KBMOglobalGeneralCancelDispatch._x<0?KBMOglobalGeneralCancelDispatch._x=0:KBMOglobalGenera>
    KBMOglobalGeneralCancelDispatch._x > 380 - KBMOglobalGeneralCancelDispatch._width? KBMOglobalG eneralCancelDispatch._x = 380 - KBMOglobalGeneralCancelDispatch._width:KBMOglobalGeneralCancel Dispatch._x;

    Thanks again for your time!

    do you know? : operator? It's as if... else... statements,

    When we say:

    somethingIsTrue? do1(): do2();

    This is exactly the same direction as:

    If {(somethingIsTrue)
    do1();
    } else {}
    DO2();
    }

    Now, we look at this line:

    KBMOglobalGeneralCancelDispatch._x<0? kbmoglobalgeneralcanceldispatch._x="0:">

    It is same as

    If (KBMOglobalGeneralCancelDispatch._x<0)>
    KBMOglobalGeneralCancelDispatch._x = 0
    } else {}
    KBMOglobalGeneralCancelDispatch._x
    }

  • setValue for entering text within the pop-up window giving NullPointerException

    Hi all

    I want to put the value programmactically for entering text within the pop-up window

    I write the following code in the bean (extended view)

    to fill the text to enter the PopupFetchListener

    {} public void setMyInput (myInput RichInputText)

    this.myInput = myInput;

    }

    public RichInputText getMyInput() {}

    return myInput;

    }

    {} public void fetchText (PopupFetchEvent popupFetchEvent)

    Add the code in the event here...

    myInput.setValue ("test"); gives NullPointerException

    }

    JDeveloper 12 c

    First, link component UI (with the exception of fragment) to the scope of request bean.

    Then, try to play with the popup childCreation property (try with immediate)

  • I deleted my subscription for first month within the first 30 days, and I want my refund

    I deleted my subscription for first month within the first 30 days and I want my refund

    This is a forum for user to user with the space provided by Adobe, not the Adobe support

    Adobe contact information - http://helpx.adobe.com/contact.html

  • How to call an eventlistener for CMD - W

    Is it possible to create an eventlistener for CMD - W, I want to do something other than just to close my user interface menu.

    At soon Daniel

    Try this

    if (event.keyName=="W" && event.metaKey)
    

    I can't test it, it is from the documentation

Maybe you are looking for

  • Suddenly all of saved passwords are gone on my pc. How can I get back them?

    All saved passwords disappeared suddenly. It's there, but I restart my PC and open my Firefox and none of them are there.How should I restore them?

  • project school aid

    Hi guys I am involved in the hit-challenge and I had a few questions, this is my first time using labview, had 2 classes of fast access in it. so please be easy on me I have included my file in this post. We work with an arduino to identify 2 playmob

  • Checked menu with item properties bar

    I have an element in the checked menu with properties enabled. I fail to have checked the properties. What do I have to use GetCtrlVal and SetCtrlVal to get and set the properties checked? Whenever the user click this menu entry, I would like to chan

  • I think I deleted something I will not, I have no sound at all

    I think I deleted something I need not to. I have no sound at all. Original title: audio problems

  • problem installing downloaded programs

    Hi everytime I try to install a downloaded program I get an error message saying that it is not a valid win32 application that he did with the programs downloaded from Microsoft. It downloads the file but when I install the thing of security open fil