ActionScript 1/2 :: Detecting Click On An MC Inside An Attached Movieclip?
Apr 23, 2011
I'm working with a MovieClip ("mainMenuItem") that is linked to a Class ("GenericMenuItem.as") that uses attachMovie to add another movieclip ("Arrow") to mainMenuItem as follows:mcArrow = this.attachMovie(prefix+"Arrow", "_Arrow_symbol", this.getNextHighestDepth());I'm able to use on(release) within the Class definition to capture clicks on the mainMenuItem component, but haven't been able to find a way to detect a click on the "Arrow" library item that gets attached to that component.
View 2 Replies
Similar Posts:
Dec 4, 2011
I want to apply actions to a movieClip nested inside a dynamicly attached movieClip, with the attachMovie method; it doesn't works when the movieClip is attached by a button:
1.when the swf movie loads with an attachMovie method the remove_btn clears the window_mc
[Code]....
View 9 Replies
Oct 8, 2009
how I would normally generate a dynamic text field,
Code:
this.createTextField("myTextField", 1, 0, 0, 100, 200);
myTextField.wordwrap = true;
myTextField.text = "text1";[code]....
I would like to target the text field so it is generated inside a movieclip for example something like,
Code:
_root.Mymovieclip.createTextField("myTextField", 1, 0, 0, 100, 200);
myTextField.wordwrap = true;
myTextField.text = "text1";[code]....
View 3 Replies
Jan 7, 2011
I have an AS3 project (publishing to FP10) where I load a custom made window from the main movie. The custom made window is saved in the Library and has a close button (called exitinteraction_btn).
I manage to load the window from the main movie with the following:
var WinA = new windowa(); addChild(WinA); var myTween:Tween = new Tween(WinA, "x", Elastic.easeIn, 175, 175, 5, true); var myTween:Tween = new Tween(WinA, "y", Strong.easeIn, 175, 175, 5, true);
This is the code in my custom window (which I cannot manage to close and have it remove itself from the main movie when clicked):
exitinteraction_btn.addEventListener(MouseEvent.CLICK, closeI);
function closeI(e:Event):void{ this.unloadAndStop();
}
I get the following error:
TypeError: Error #1006: unloadAndStop is not a function. at windowa/heyb()
View 5 Replies
Dec 11, 2007
I have a layer called SCRIPT and on the first frame i put an actionscript that attach a movieclip (attachMovie). After i attach that movie clip i set the _x and _y coordinates to a specific place. This movie clip has a combo box inside.On another layer i have a button, when you click on this button i attach a movie clip (attatchMovie), this is the same movieclip i attached before on the first frame of SCRIPT layer.Here is the problem, when you click on the button for second time the movieclip attached go to coordinates 0,0.but, if a open the movieclip and delete the combobox everything works fine.Im including a very simple fla file to illstrate the problem, feel free to download it to see what im talking about.
View 2 Replies
Feb 2, 2009
The proposed task has to do with the creation of an application in which the user will be able to insert, drag&drop and remove rectangles. The properties of each rectangle (name,x,y) should be saved in an xml instance.
1.Create a vertical toolbar with the above buttons:
a.new rectangle
b.move
c.delete
2.Create a movieclip that will be your workspace on the right of your toolbar named stage.
3.Create a function that will be triggered by the new rectangle button and will attach to the stage rectangles as movieclips named rectangle(i) (rectangle1, rectangle2,...).
4.Create a function that will be triggered by the move button and will drag and drop a selected rectangle.
5.Create a function that will be triggered by the delete button and will remove a selected rectangle.
And what I have done so far is:
i = 1;
newrectangleButton.onRelease = function() {
stageMC.attachMovie("rectangleID", "rectangle"+i, i);
stageMC["rectangle"+i]._x = Math.random()*stageMC._x;
[Code].....
View 0 Replies
Jan 6, 2010
I have made a sort of drop down menu of a movieclip. There are actually two, the first one named list_over_mc is only to detect when the mouse is in the area for when to drop down the menu (onRollOver) and the other one, list_mc, is holding the menu itself. The problem is that when the menu is down nothing happens when I click the button (now named knapp1_btn). I have tried with another but with the same sort of script (but placed outside of the movieclip list_over_mc) and that works so I'm guessing it is because the button is "over" the other movieclip.
View 3 Replies
Dec 13, 2010
I have a draggable movieclip, mc_PI on stage in which I have another movieclip, mc_PIcontainer into which I load an image.I then place a few buttons, btn_Ant1, btn_Ant2, etc. inside mc_PI.mc_PI drags just fine within the bounds I specify, but I cannot click on any of the buttons that are located inside mc_PI.I need the buttons to be inside mc_PI, because I need them to drag along with the image located in mc_PI.mcPIcontainer.[code]
View 11 Replies
Jul 22, 2011
i found a script that unloads my external swf inside a movieclip when i click a button on my main screen. this script causes the external flash inside my moviclip to close and unload when i click the close button, which is what i want!. the only pain in the butt is it preloads the external flash when you go the flash site and i dont want that. i only want the script to close the external swf. if anyone is curious book.swf is the swf in the movieclip i am trying to close.[code]
View 1 Replies
Jan 6, 2007
Is there a way of detecting a right-click through actionscript?
View 7 Replies
Feb 2, 2009
is there anyway way possible to apply actions to a button something like this...on(right click);Gotoandstop(1)so that when you rightclick the button, it will go somewhere? Ive been looking with no avail.
View 8 Replies
May 27, 2009
having trouble accessing a button within an mc placed on the stage using attachMovie.[code]it just doesn't seem to reference the button with the instance name 'zoom' that is inside the 'text01' mc. i've tried _root.text01.zoom as well.
View 3 Replies
Apr 25, 2001
I'm making the simplest swf for a friend who has real problems remembering the actions of a Left and Right click with the mouse. So I would like to show text when "Right" click is detected and the same for a Left click. This at first seemed an easy project but the right mouse detection has got me baffled.
View 4 Replies
Jun 6, 2005
Is there a way to detect if a user has clicked on a textbox or if a certain textbox is active? IM NOT USING MX 2004 COMPONENTS. Im using just MX components.
Would I need to set up a listener for this?
View 3 Replies
Jan 17, 2005
Is it possible to detect when a user is clicking while simultaneously pressing a button on the keyboard? For instance, if a user presses "a" on the keyboard and then clicks on a specific movie clip, I'd like to trigger an animation.
View 3 Replies
Jul 12, 2006
i am loading some thumbnails from an xml file into a movieclip using attachMovie() - each thumbnail loaded is in it's own MC inside the 'container' MC. everything works great but i need to be able to scroll the thumbnails b/c the number of thumbnails can change but the space they have to fit into cannot. make sense? if attach them to a scrollpane or a textarea instead of a MC it only shows the last thumnail loaded or iterated in the for loop.
Code:
articleNos = seasArts.firstChild.firstChild.childNodes.length;
var item_spacing = 55;
var item_count = 0;
[Code].....
View 4 Replies
Apr 5, 2007
I have attached a file called datetool.fla, inside this fla i have created 5 buttons which has Prev Date, Prev Week, Next Date, Next Week, Toady. And 3 dynamic text boxes.
View 13 Replies
Aug 1, 2007
Im attaching lots of movies in to empty clip in a for loop.like this
Code:
...
for (i=total-1; i >= 0; i--) {
[code].....
View 2 Replies
Jan 29, 2009
I've got clips being attached using attachMovie (clips are in the library with linkage id's).
inside those clips are two functions. I'm trying to access those functions after I attach the clips, but not getting anywhere.
I assume that the methods of my attached clip (the functions) aren't available immediately, but rather after the clip actually 'loads' to the stage they are.
View 3 Replies
Jul 21, 2011
I know that datagrid can detect changes of single mouse click with
//add listener
myDataGridList.addEventListener(Event.CHANGE, myDataGridListChange);
public function myDataGridListChange(e:Event):void{
trace(myDataGridList.selectedItem.id);
}
but can they detect double mouse click?My purpose of doing this is that, if the user double click on a datagrid row, I need it to return me value of myDataGridList.selectedItem.id, so that I'm able to continue to proceed to the next stage of my game.
View 4 Replies
Jul 22, 2011
I am making the board game Shogi in actionscript 2 and I have a question on how to detect a particular imput.I have a movie clip on the stage, I want it so that if I hold down the keyboard button "p" and then click on the movie clip, it will go to the movie clip's frame 2 (not the entire flash project's frame 2, just the particular icon's frame 2. I need this because I am using movie clips as game pieces and in Shogi, certain game pieces can be promoted. I also was wondering how to detect what frame it is on.
View 3 Replies
Oct 2, 2009
i have 2 intersecting movieclips.
is there a way to hit test point NOT detecting a bottom movieclip if the mouse is over the top movieclip?
View 3 Replies
Jan 25, 2012
I have a Button that is inside MovieClip1 which is inside MovieClip2; yet when i click the Button it doesn't dispatch Event.
View 5 Replies
Sep 2, 2009
I have a Card class. From this class, I have three possible children: Photo, Video and Info. In my main class, I want to create a few instances of these different classes without knowing what kind it is. But, no matter that, I want them all to listen to the mouse, so I may have something like this:
ActionScript Code:
var item:Card = new Photo();
item.addEventListener(MouseEvent.CLICK, mouseHandler);
The thing is: the Card class is kinda like a canvas... it has certain properties common to every type of item, but there's a space where it leaves it as a canvas... a Photo instance will load a photo there, a Video instance will load a video and a Info instance will load text to a TextField. The problem is that the event listener doesn't work the way I want it to... on an Info instance, the target of the click is the TextField; on a Photo instance is the picture... I want them all to be the class itself... in other words, I want to be able to parse the target as a child of the Card class. My code for the mouseHandler method is
ActionScript Code:
private function mouseHandler(e:MouseEvent):void
{
if(e.target is Photo)
[Code].....
That's the main idea... to be able to know what kind of object I'm clicking and access its properties... but on an Info instance, e.target is of type TextField... to be able to access the Info object, I have to do e.target.parent, and that is NOT the idea.
View 1 Replies
Nov 29, 2006
I am trying to reference a movieclip within a movieclip that I am loading using "attachmovie". In the first frame of the root, I am attaching the movie. Then, from the attached movie I am calling a function that is also in the first frame of the root. In the function I am tring to set the property of a clip within the attached movie to visible using the following code:
_root.logIn.loginMessage._visible = true;
I have also tried _root["logIn"].loginMessage._visible = true; with no luck.
(logIn is the name of the clip I am attaching using attachMovie and loginMessage is the clip I am trying to reference in the attached movie)
This is how I'm loading it and I know that part is working: _root.attachMovie("login_mc","logIn",getNextHighes tDepth());
View 1 Replies
Mar 15, 2012
Project: Flash Professional CS5.5 | AS3Platform: Mac OSX LionI have a projector that calls on an attached movieclip with the following function:
function fbtnclicka(e:MouseEvent):void{
var mc:moduleexit_mc=new moduleexit_mc();
}
[code]......
View 19 Replies
Jun 6, 2011
The following is the chunk of my code that is attaching a movieclip (from timeline), tracing thisDot works so it is not the variable which is a problem but there is no rollover applied to the attached movieclip.
var dot_name:String = new String(Graphs[s]._name+"_dot"+i);
var dotObj:Object = new Object();
if (prevX != undefined) {
dotObj._x = newX;
[code].....
View 1 Replies
Feb 22, 2010
I was wondering if there was any way to put code on an attached movieclip?
View 4 Replies
Oct 23, 2009
I have short script (onClipEvent (enterFrame) {some code here}) that works well on movieClip that is on Stage. I've added the script to 'actions - movie clip' -window). But my problem is that movieclip should be attached dynamically usign actionscript, so I cannot add the script to the clip, as I used to.
View 1 Replies
Mar 23, 2009
Is there a way to detect what events have been attached to a movieclip?
I want to remove an event listener only if it has been added, and add it only if it hasn't been added yet.
View 1 Replies