ActionScript 2.0 :: Targeting A MovieClip Without Using _root?
Jul 28, 2007Im trying to target a movieClip one level up... i could use _root but its not doable in this case?
View 7 RepliesIm trying to target a movieClip one level up... i could use _root but its not doable in this case?
View 7 RepliesIn the code below i want to change the _root.broj and _root.logo variables inside the function which returns values from .php file. Inside the function everything works fine and all values are correct but when i trace var broj outside the function it's still 0.
var result_lv:LoadVars = new LoadVars();
var send_lv:LoadVars = new LoadVars();
var broj:Number=0;
var logo = new Array();
[Code].....
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.
im lookin to make this so that the points taken from the _root.cargo are multipled by 10 and added to _root.totalscore
[Code]...
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 RepliesI 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 Repliesif a condition is true, then:_root.(MC with instance name that is the value of "_root.eelmine").nextFrame(); is this correct?_root._root[eelmine].nextFrame();
View 16 Repliesis _root same as _level0? or is _level1 the timeline inside a movieclip on the _root?
View 5 RepliesIf I have a movieclip on the main timeline, is there a way to put this movieclip inside another movieclip on stage (ofcourse during runtime) ? I know that one of the methods of doing this is using bitmapdata class to capture an image of the movieclip (draw method), then attaching the object it to another movieclip that can be anywhere, but this will make the movieclip lose it's interactivity behaviour, and vector quality.
View 5 Repliesgot a problem.. if i load an image into _root.pic_mc movieclip and its loaded i try to load anotherone in the same mc.. now the pic_mc turns white and the picture disappears.. so i tried to make a duplicateMovieClip on the pic_mc but this also didn't work. any other solution on this problem?
View 2 RepliesI have two movie clips on stage, each with the same code, I have another movie clip that comes along and interacts with the two of them and changes properties to its speed and such. The problem is, it only seems to work one at a time, for instance I can't have both of the movie clips changing its speed, it works with one and then ignores the others code. *EDIT* I just ran a trace on the two mcs, I can confirm both of them know when the main one hits it, but because I'm trying to change a _root.mc.speed property in each one, it only accepts one of them and ignores the other for some reason :S If I use different properties in each it allows that.
View 5 RepliesI 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]...
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]....
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....
I`m trying to set-up a script that changes the color of a movie clip, depending on the current url of the page... My code is:
Code:
var link = "http://localhost/v-v/indexSRP.php?kategorija=";
var link2 = "http://localhost/v-v/index.php?kategorija=";
if (_root._url.indexOf(link + "3") == 0) {
[Code].....
I just recently began migrating from AS2 to AS3, and I have of course realized that I can no longer move the "_root" by changing the _x and _y positions of the _root (which no longer exists in AS3). How can I do this in AS3 (specifying _x, _y, _z possibly of the "_root")?
View 2 Replieson 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.
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....)?
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.
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")
}
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]........
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.
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 RepliesOk, 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.
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();
}
How to target a label within a movie clip on the main timeline, from a button within another movieclip on the maintimeline.
View 0 Repliesi 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]...
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]...
When you click a button I want my flash to go to the frame label where the movie clip is located, and then play a certain frame of that movie clip.
View 5 RepliesI've been searching the forum for an answer, but I'm either not searching for the appropiate keywords, or having really really bad luck... so feel free to point me to any threads that might contain the solution to this.
Here's what I'm trying to do:
I have a site which is fully made in flash, and has one big index.swf file. Each section loads dinamically into it with a preloader (this works OK).
I didn't make a preloader for the main index.swf at first because it was really small, but as I've added more and more features to the site, the index.swf grew bigger and bigger, until I felt I need a prealoader for it as well.
However, I NEED the index.swf to load into the ROOT of the main timeline, as there are some functions in the site that call movieclips with absolute paths ("_root....") rather than relative ones ("_parent._parent...."), and I can't change that for various reasons, so I need to keep that hierarchy intact.
But there's an obvious problem if I try to do this via a MovieClipLoader:
If I tell the MovieClipLoader object to load the clip into "_root" like this[code]...