ActionScript 2.0 :: Targeting A Child MovieClip?
Apr 28, 2009
so I am building a image scroller, that is fairly simple, but I am really having a hard time with targeting the clips inside the main clip. Here is the code that makes the scroller either visible or not :
mouseOverClip.onRollOver = function() {
TweenLite.to(mouseOverClip, .5, {_y:107});
mouseOverClip.rotateImg.gotoAndPlay(2);
[code]....
now in mouseOverClip, I have a clip called clipA that I need to perform a function when the mouse rolls over, however since the mouseOverClip is "listening" for the mouse over/out, its ignoring clipA. someone help! Im thinking there should be logic inside the rollOver to check what clip im over and to perform a function if that is true....
View 1 Replies
Similar Posts:
Sep 15, 2009
I'm trying to set properties on a child that has been dynamically added to another MC and whilst I call call functins that are in the child's class, I cannot adjust it's properties.[code]
View 5 Replies
Oct 20, 2004
I have a movie clip on the main timeline calledbg_graphics, I want to target a movie clip within that movieclip called bg1_mc. to gotoAndPlay frame 2.The bg_graphics clip goes to a random frame within that movieclip, there are 3 frames. 1st has bg1_mc, 2nd has bg2_mc, and 3rd has bg3_mc. How could i determine which file to gotoAndPlay frame 2 in bg_graphics when i don't know exactly which frame its going to be on, let alone target a movie clip within a movie clip.I used this code to generate the random frame
function randomBg() {
//generate random BG based on random frames within the MC
randFrame = random(3)+1;[code].....
View 7 Replies
Sep 8, 2009
i have a parent movieclip mcA and i want to add another movieclip mcB (child movieclip) inside mcA such that the extra part of mcB is hidden. The size of movieclip remains same as of mcA
For ex:-
mcA = 300x300
mcB = 400x400
then only 300x300 of mcB movieclip is visible and rest of the part is hidden.
View 5 Replies
May 18, 2010
On the stage I have a movieclip called mc_back. I also have a movieclip on the stage called mc_content. Now, inside mc_content I have a bunch of code and some of it adds, or should add, an EventListener to mc_back as well as a a function that works when mc_back is pressed.
So basically, all code is written inside mc_content and some of it needs to interact with mc_back.
how to target mc_back from inside mc_content. Using stage.mc_back or root.mc_back doesn't work and Google should be my friend, but in this particular problem, it's acting more like my enemy.
View 8 Replies
May 3, 2011
I have a mock up fla file showing what i am trying to attempt. I have a button nested in a movie clip on the second frame on main timeline called PageBackBtn. I am trying to get this button to target a label within a movieclip on the first frame of the main timeline. The label also is called PageBackBtn within the movieclip on frame one.
View 0 Replies
May 4, 2011
I have a mock up fla file showing what i am trying to attempt. I have a button nested in a movie clip on the second frame on main timeline called PageBackBtn. I am trying to get this button to target a label within a movieclip on the first frame of the main timeline. The label also is called PageBackBtn within the movieclip on frame one.
View 1 Replies
Jan 26, 2010
I have a main swf that loads an external swf (WNC.swf). The external swf (WNC.swf) contains a scrollPane that loads another external swf (WNC_DATA.swf). I'm trying to target the WNC_DATA.swf from the main swf, so I can tell it to go to frame (2). The following code targets the first child swf (WNC.swf), however I'm unable to target WNC_DATA.swf inside the scrollPane.
[Code]...
View 5 Replies
Oct 28, 2006
i have a for loop and i want to do things with it:
for(i;i<=2;i++){
if(box+i._width>20){
var box_width:Tween = new Tween(box+i, "_width", Elastic.easeOut, 750, 20, 3, true);
[Code]....
View 5 Replies
Jul 28, 2007
Im trying to target a movieClip one level up... i could use _root but its not doable in this case?
View 7 Replies
Aug 19, 2009
how to remove all child of a movieclip if no of child are not known
View 2 Replies
Jul 12, 2010
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.
View 3 Replies
Oct 13, 2011
I always face this problem when coding with flash, and still not able to get a solution for this problem....
if the nested mc is in the 1st frame then I can use: Level1_mc.Level2_mc.Level23_mc.gotoAndStop("2");
If refering nested btn I will use: MovieClip(parent).gotoAndStop("2");
so my question is, how about refering an mc from main timeline into nested mc but different frame( frame 4,5 or 6....)?
View 6 Replies
Jun 1, 2009
On my main timeline, I have a movieclip called "mainpage". Within "mainpage", I have a button that when clicked upon, needs to go back to the main timeline, into another movieclip, and to a specific frame in that movieclip. The code I've been using for all my other buttons is this:
Code: Select allfunction goAdler (e:MouseEvent):void{
MovieClip(parent.parent).gotoAndStop("adler");
}
adler_proj_btn.addEventListener(MouseEvent.CLICK, goAdler);
In that particular case, the button is going up to the parent movieclip of it's parent to a specific frame label.The problem I'm having is that I need for this button within "mainpage", rapp_proj_btn, to go to the main timeline, go into a movieclip a few frames down called "portfolio_content" (on a frame labelled "Portfolio"), and to a frame labelled "rapp". No matter what I've tried, I can't seem to target the "portfolio_content" movieclip, even though I've put the instance name on it and everything. I can, using the code below, get the rapp_proj_btn to go to "Portfolio", but I can't get inside that "portfolio_content" movieclip that sits on that frame.
This is the code I use to get to the proper frame:
Code: Select allfunction goRapp (e:MouseEvent):void{
MovieClip(root).gotoAndStop("Portfolio");
}
rapp_proj_btn.addEventListener(MouseEvent.CLICK, goRapp);
I tend to get an error describing not being able to get to an undefined property called "portfolio_content", and to be honest, in AS3, I'm not exactly sure how to go about fixing that error. I've tried calling the "portfolio_content" instance name in the code (right before gotoAndStop), but it doesn't recognize the movieclip.
View 12 Replies
Feb 27, 2008
I built a button, but as a movie clip. It's nested with in another movie clip on the main timeline. How do I go about targeting the button?- when I have it on the main timeline, it works fine. But once it's nested. The action script can't find it.
Here is the code I'm using:
btn1.onRollOver = function () {
this.gotoAndPlay("in");
} btn1.onRollOut = function () {
this.gotoAndPlay("out")
}
View 10 Replies
Jul 23, 2009
First let me say I'm relatively new to AS 3 and I've scoured the Internet looking for a simple solution to no avail.Here's my general situation:1) I have dragged a movieclip with an instance name of a_mc onto the stage.2) On the first frame of the timeline I am importing a class file and calling its constructor:
Code:
import cardmaker.*;
var coverMaker:CoverMaker = new CoverMaker();
[code]........
View 1 Replies
Jul 9, 2009
How do you target a certain frame number/name from outside of that specific movieclip?
Code:
whoweare.addEventListener(MouseEvent.CLICK, whoweareClick);
function whoweareClick(event:MouseEvent):void{
gotoAndPlay("whoweare");
}
I'm assuming it's something with the gotoAndPlay function... but I've tried numerous things with that and nothing is working.
View 3 Replies
Dec 9, 2009
I have been searching for an answer to this and can't seem to find one for AS3:I have a scroll pane component that dynamically loads a movie clip from my library. This movie clip has buttons inside that I would like to access from my main timeline. I can't figure out what my target path should be (for AS3).In AS2 it appears that it would be something like this:scrollpaneName.spContentHolder.inside_btn...AS3 doesn't recognize spContentHolder though so it must be something different...
View 4 Replies
May 2, 2011
Ok, i bought a scroller that works well scrolling content. With elasticity and stuff.
My problem is trying to access buttons inside the scroller.
I have an instance of the scroller component on stage and named it Scroller. I set the content in its component inspector. It loads a movieclip from the Library called Panel. Inside the Panel i have 2 buttons. button1 and button2. If i publish everything works fine.
Now i am not very good at AS3. How do i access the buttons. i've tried this among other bits and pieces i found on the web.
Scroller.Panel.button1.addEventListener(MouseEvent .CLICK, somefunction);
Can't get it to work. I know the Panel movie out of the library that the Scroller component loads needs to be somehow listened for but i don't have a clue.
how to access the buttons without getting an error
1119: Access of possibly undefined property button1 through a reference with static type Class.
View 4 Replies
Oct 31, 2011
If I have a movieclip on the main timeline, and a button in that movie clip. How would I go about getting it to advance the main timeline to its next frame? I understand that in AS3 movie clips are not connected to the timeline in the same way as they are in AS2 but I dont understand why the following works, or if there is a better way?
stop();
next_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler1);
function mouseDownHandler1(event:MouseEvent) {
MovieClip(this.root).nextFrame();
}
View 2 Replies
May 2, 2011
How to target a label within a movie clip on the main timeline, from a button within another movieclip on the maintimeline.
View 0 Replies
May 6, 2004
i have a problem adressing or targetting a attached mc when i target de mc directly it works fine but when i try it trough a variable it doesnt recognise its path anymore??? hopefully a part of the code is gonna explain the situation a litle better... this piece works fine:
[Code]...
View 3 Replies
May 6, 2004
i have a problem adressing or targetting a attached mc when i target de mc directly it works fine but when i try it trough a variable it doesnt recognise its path anymore???
[Code]...
View 3 Replies
Oct 24, 2010
I have movieclip which contains child movieclip. when child movie clip finish to play i want to run a function in a parent movieclip. so I made a custom event dispatcher in the first frame of the child movieclip:
[Code]...
View 4 Replies
Mar 15, 2012
I have load child swf in parent swf, from child swf i am trying to run my parent swffunction I am trying this code
MovieClip(parent).testfun()
but this code is giving error.
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Loader@2b1aa061
[code].....
View 1 Replies
Mar 12, 2011
below shows how to add child in a movieclip. ebd.target.addChild(info_grd); there is button named my_btn inside the movieclip info_grd.I would like to remove movieclip info_grd.parent
View 2 Replies
May 17, 2011
I'm trying to access a parent movieClip from the child movieClip
Here's what I want to do,
I've got a movieClip named wrong_mc, which plays for a couple of frames and on the last frame, its got a close button "close_btn" inside of it, now I wanna write the code such that when close_btn is played the movieClip "wrong_mc" should go and stop at frame1, I'm just not able to access this movieClip from the button.
View 5 Replies
Aug 13, 2009
I've got a dozen movie clips on stage, each with 3 children, and each of those have 8 children, as example named u01-u08.
Is it possible to access u01 directly without the parent names? like a wildcard? like the xml way of getting to nodes with a .. ?
sort of like: stage..u01.alpha = .5;
View 10 Replies
Mar 25, 2009
I have a picture on the stage that has multiple items that have hotspots/links over them that should open a child swf on top of the background and show details about the items. then have a button in the child swf itself that removes the child from over the background so the user can click on another item etc.I found this code in someone's post and I am trying to modify it so that works for multiple swf files...it currently works for a single swf.I wan to pass the name of the button in front of the .swf in the URLRequest to have the same name as the instance name of the referring button. But I can't figure it out. Here is the code I am using on the stage
View 2 Replies
Aug 29, 2011
The issue I am having is that I have no idea how to access the Children of another MovieClip. I have 2 MovieClip's, storeFront, at frame 25, and reviewPage, at frame 60. storeFront contains a vector, cart, and I need to access it from reviewPage.
I have tried...
var appRoot:MovieClip = parent as MovieClip;
buff = appRoot.getChildAt(30);
review = buff.cart;
[Code].....
View 5 Replies