Targeting Dynamic Clips In Array
Hi Guys. I made an array containg 3 clips and dynamically attached them to my main timeline. I can successfully tween all of them with the following code. Code: import mx.transitions.Tween;import mx.transitions.easing.*;xpos = 50;ypos = 100;mydistance = 20;var myclips = ["blue","grey","red"];for(i=0;i<myclips.length;i++){ var b = this.attachMovie(myclips[i],"myclip2"+i,i); b._x = xpos; b._y = ypos; xpos += b._width + mydistance; b.onRollOver = function(){ new Tween(this,"_xscale",Back.easeOut,this._xscale,120,3,true); } } However, what I want to do is to target the three with different tweens. For example, how do I tween the _xscale of one and the _x of the one next to it? I know I can do it without having dynamically attach the clips but this method (if I can learn it) seems to have more power. Thanx in advance!
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 06-29-2006, 04:23 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Targeting Clips With String References From An Array?
Hi All,
i have an array which contains "target paths" to several movieCLips around my stage.
Now when i click a button, i want to tell all of the movieClips to move 20 pixels upwards at the same time
All of my target paths are stored in an array called "whatsOnTheStage"
so i have the following code and i cant seem to target my movieclips
=============================================
for (var i = 0; i<=_root.whatsOnTheStage.length; i++) {
if (_root.whatsOnTheStage[i] == "_level0.container.lineitem1") {
_root.whatsOnTheStage.splice(i, 1);
}
if (_root.whatsOnTheStage[i] != "_level0.container.lineitem1") {
trace (_root.whatsOnTheStage[i]);
setProperty (_root.whatsOnTheStage[i], _y, (_root.whatsOnTheStage._y-20));
}
}
The first part of the code does what i want and removes a certain section from the array, but i cant get the second part to adjust the movieCLip positions??
Am i able to target a clip with a string reference like this??
thanks in advance
gilesb
Targeting Dynamic Text Box In An Array
I'm trying to target a dynamic text box for a slideshow that is located in an attached movieclip.
This is the array:
var slideShow = ["slide1", "slide2", "slide3", "slide4"];
Each slide is a movie clip that is loaded with attachMovie(). These movies each have a dynamic textbox named "slideDescription". How would I be able to target that text box and get it to change the desciption each time I move to the next slide in the array?
Here is the code for the attachMovie() if you need it.
slides.attachMovie(slideShow[i], "slide", 1);
Thanks
Targeting Dynamic Text Box In An Array
I'm trying to target a dynamic text box for a slideshow that is located in an attached movieclip.
This is the array:
var slideShow = ["slide1", "slide2", "slide3", "slide4"];
Each slide is a movie clip that is loaded with attachMovie(). These movies each have a dynamic textbox named "slideDescription". How would I be able to target that text box and get it to change the desciption each time I move to the next slide in the array?
Here is the code for the attachMovie() if you need it.
slides.attachMovie(slideShow[i], "slide", 1);
Thanks
Looping, Then Referencing Dynamic Clips From Array
i'm looping thru xml nodes and using this to attach clips to an empty mc:
Code:
item = _root.mainHolder.links.linkHolder.attachMovie("linkClip", "linkClip" + i, i);
my question is how can I reference the previously attached clip so I can determine the _y property of the current item(clip).
I'd like to do something like this.
item._y= previously attached clip._y-previously attached clip.height
that way my dyn clips can resize based on how much text...
get it?
Nested Clips Targeting Other Clips On Root..
ok check this out guys.
3 frame movie
each frame has seperate clips
frame two has a animation clip nested inside another clip, so two clips up on frame two of root has navigation button "back"
i need to get back to root frame 1 clip "intro" frame 250 of that clip
here is what i have on the button:
on (release) {
_root.intro.gotoAndPlay(250);
}
not working. Why?
Thanks in advance...
---------------------------------------------
www.orlandomediasolutions.com
www.mlstaffing.com
www.mwll.com
Targeting Clips.....
Alright,
How can I target a movie clip in the library (that is not on the stage because it is being exported for actionscript)
Targeting Clips?
I am completely stumped with targeting objects in AS3.0. The situation is this; I have two movieclips on the stage (manually, _NOT_ dynamically, placed), and I want to target clip1 from clip2. In AS2 you could put something like this in the clip1 timeline:
_root.clip2.gotoAndPlay(2);
or use a more relative path:
_parent.clip2.gotoAndPlay(2);
This was BASIC functionality in AS2, and yet AS3.0 seems to have NO such way of doing it. Do I access it through the displaylist? Do I target the stage instead of _root? I've searched and tried everything I can think of! Any help is much appreciated!
Pete
Help With Targeting Clips.
Here is what I am trying to do. I have a main.as(This is my Document class) that pulls in a video class(a bunch of functions). In the video class I have a loader that loads player.swf. I tell main.as(class) when it is done. Now at that point I am trying to target the header_mc inside the player.swf from my main.as class. It seems if I call the header_mc from within the video class it works but if I try to target it from main.as it is a no go. Is there a way to target clips inside a swf that was loaded from an imported class.
So just to help understand this.
Main.as is the document class
-- imports video.as and adds new instance (public var my_video:VideoClass = new VideoClass("player.swf"))
---- Inside video.as I load "player.swf" (player.swf contains a header_mc.txt.text)
Main.as is told that video.as and player.swf is done.
in Main.as I am trying to target header_mc.txt to add info in it. but so far I have had no luck.
Has anyone tried this and is this possible?
main.as -------------------------
_gallery = new Video_Player("player_nocom.swf");
addChild(_gallery);
------------------------------------
Video_Player.as -------------------------
public function load_player():void {
_loader = new Loader();
_loader.name = "VIDEO_PLAYER";
_loader.contentLoaderInfo.addEventListener(Event.C OMPLETE, _swf_complete);
_loader.contentLoaderInfo.addEventListener(IOError Event.IO_ERROR, doIOError);
_loader.load(new URLRequest(_load_swf));
}
public function _swf_complete(evt:Event):void {
var loaderInfo:LoaderInfo = evt.target as LoaderInfo;
addChild(evt.target.content);
_use_player = loaderInfo.content;
}
-----------------------------------
player_nocom.swf -------------------------
this stores a bunch of movieClips what I want access to from my main.as class
------------------------------------
Thanks in advance for your help.
--Jose
Targeting Movie Clips
Can someone please help me!!! I am trying to link between a button and two html frames. I have figured out how to load the flash files into each html frame, but I cant seem to target the appropriate movie clip. I have tried to use tellTarget, loadMovie, getURL and also gotoAndPlay, but I can't nut it out. I'm sure it's probably something simple, but I just can't figure it out.
The html frame I'm trying to load the clip in is called "header.html", the button I'm trying to load from is located in a separate frame called "nav.html", the swf file is called "header.swf" and I'm trying to load a movie clip called "melb_tours_clip" or the frame name of "melb_tours" but it keeps loading the first frame of the "header.swf" which contains a "home_clip". The scipt i've most recently used is below.
on (release) {
getURL ("melb_index.html", "content");
getURL ("header.html", "header");
tellTarget ("melb_tours_clip") {
}
}
All the lines work except for the tellTarget line.
Please help me
Targeting Movie Clips
I'm having trouble getting variables to show in my flash movie. I've gotten the variable to load using loadVariables and they show up in the variable output of the debugger. I'd like to target them to a movie clip that has three text fields in a row and then repeats them as it moves through the array.
Here's that code
for (cIndex=0; cIndex<djoutput.length; cIndex++) {
mc_artisttable.duplicateMovieClip("djmc"+cIndex,cI ndex);
this["mc"+cIndex]._y = 0+(mc_djeditable._height*cIndex);
this["djmc"+cIndex].artistname = djoutput[cIndex];
this["djmc"+cIndex].genre = genreoutput[cIndex];
this["djmc"+cIndex].id = idoutput[cIndex];
}
I just can't seem to get the variables into the text boxes in the artisttable mc. Should they be dynamic w/ artistname, genre, and id as the variable, or should they be smart clips. any help would be greatly appreciated.
-Mike
Targeting Movie Clips
hello, i'm trying to change the scale of a movieclip with a button, and that works fine, but how can i make the button check to see the size of the clip? would it be somthing like:
on (release) {
if (_root.XmovieclipX._xscale > 640) {
_root.sizes = "2";
} else {
_root.sizes = "0";
}
}
naturally this script dosn't work for me, am i targeting it wrong?
thanks in advance
Targeting Clips Dynamical V.MX
Does anyone know how to target movie clips dynamically? Here's my code that doesn't work:
var sectionArray = new Array("doorF", "doorH", "locks", "general", "rough", "power", "hand");
var section = sectionArray[sectionNum];
trace (_root.section._alpha);
_root.section._alpha = "100";
If you can't tell from the code, I'm reading in a variable that selects one of the array elements. Then I'm trying to run the command "_root.section._alpha = "100"; where section is a string that corresponds to one of 7 clips on the stage. These names are those in the array. The trace prints "undefined" since it thinks section is the actual name of a clip, which obviously isn't on the stage. Does anyone know how to get actionscript to recognize the value of section instead of the word section? I know I can accomplish this with a switch statement, but in the event that there are say 100 instead of 7 clips, that would be annoying.
Targeting Movie Clips?
I'm a bit new to flash and could use some help.
I'd like to use an if/else statement to target different frames in a movie clip. I created an instance of the desired movie clip in frame one on Stage1. I would think the code below would work in frame one, but it doesn't:
if (strTest=="products") {
gotoAndPlay("MovieClip1", 20);
}
else if (strTest=="design") {
gotoAndPlay("MovieClip2", 20);
} else {
gotoAndPlay(2);
stop();
}
I'd rather not create separate scenes if possible, but that's the only way I know how to do this.
Thanks for any help!
- Josh
Targeting Movie Clips
hey just wonderin how do you target movie clips that are several movie clip layers deep - what is the syntax for doing this??
Targeting Masked Clips
Uh oh. Is there a way to call actions to clips that are under a mask?
I had something working well when a MC was clicked on it went to frame 2.
But now I have that MC underneath a mask and it seems like no actions will call to it now.
I have verified it because when I drag the clip out from underneath the mask it works, but as soon as I drag it below it stops taking actions again.
Is there any way to work around this?
Thanks!
Targeting Movie Clips
I am having a problem targeting movie clips at diffrent levels. I have a movie clip(menu) on level two with buttons in it that calls a movie(page loader) to the root level. On frame 15 of the page loader movie I call up another movie(section) which I cannot load. I am probably not targeting it right, any sugestions would be most heplful.
Targeting Movie Clips
Hello there. I need a bit of help with a hurdle I’ve encountered. I have a movie clip loading in on the first frame of the main time-line and am using script to randomly load in one of the images within it. However, I’d like to be able, once it’s loaded in the random image, to scroll through the images using next & previous buttons that are in a separate movie clip.
I’ve attached a file so you know what I’m bleating on about.
Targeting Movie Clips
Hi all,
I am designing a site, which basically uses the technique of loading swf's into a main movieclip, I want the swf's that are loaded in the main movie clip to animate in and out. I found out how to do this using a variable 'next movie' which loads the appropriate swf into the movieclip as the previous Swf is animating out, you'll see if you look at the Fla's i have attached.
The problem I have is that as the current Swf is animating out, it should call the next swf but doesn't, the best thing is to look at the files, the 2 buttons I am using are company and Projects, which link to the swf's Company.swf and CLC.swf from Base.swf.
Somebody please help me!!!
Thanks
Targeting Movie Clips
Hi
At last i managed to get movie clips stack on top of each other, but now a new problem. Please have a look at my test site: http://www.koosha.com/m/
The code works for buttons on the stage and not for the buttons inside other clips. This is the code for the red button for example:
red_btn.onPress = function()
{
var someDepth = empty_mc.getNextHighestDepth();
empty_mc.attachMovie("red" , "redup", someDepth,{_x:200,_y:100});
trace(someDepth);
};
as soon as i move the red button inside a movie clip, it wont work. Any idea anyone?
Regards
Koosha
CS3 Targeting Movie Clips
This should be really easy yet I am having such trouble with it. I have movie clips that I am using as buttons. So I have movie clip A and have assigned a rollover and rollout mouse event on it. Within that clip A is clip B, and I have a rollover and rollout mouse event on it. Now clip A is also with a movie clip that does nothing but hold a lot of movie clips. Outside of that I can target A to do something, but not B. If I turn off the mouse events assigned to A, suddenly my mouse events for B work. I need them both to work, so that when the movie clip is moused over it reveals another movie clip that I can then press. What am I missing here?
Targeting Within Movie Clips
I know this has probably been asked before, but I can not seem to find the right answer. here is my issue, any help would be appreciated.
I have a button and when i click it I want it to go to a specific frame (labelled) in another movie clip (outside the movie clip the button is in).
So basically the script I have for it is:
_root.Movieclip02.gotoandplay("on")
My button lies here (though I don't think this matters):
_root.movieclip01.button
Movieclip 01 and 02 are on the same level (top/root level) of the movie, just in different frames, so Movieclip01 rests on the top level in frame 01, and movieclip02 rests on the top level in frame 05.
Tried to be as detailed as possible, again your help is appreciated.
Targeting Clips On Layers
http://www.pyroblue.com/test/marcomm/home.html
Theres the example to work with....anyway....as you can see, im loading in movies externally...each on its OWN different level....what i want to do is make it so that when i click a menu option on the left, the current swf loaded on the stage closes and the new one comes up (to avoid the clutter of 10 differnt windows all scattered).....here are my thoughts:
1. have variables on the root timeline that are basically "currentLoaded" and "currentLevel" -- which basically will store the name of the currently loaded swf and the level that its on.
2. each swf would have code on frame one that would see if the 'currentLoaded' varible is blank, and if not...it will close the current loaded swf ....
my dilemma is that i dont know how to change the level dynamically...i know you could do the instance name like this:
_level39[currentLoaded].gotoAndPlay("crumple") ;
but how do i dynamically change the level?
would it look like this? [currentLevel][currentLoaded].gotoAndPlay("crumple") ;
++++++++++++++++++++++++++++++++++++++++++
AND ONE MORE question...if i load things into all sorts of different levels and each with their own instance name....how do i access those objects? do i even need to worry about targeting the level?
could i use just like "instancename.gotoAndPlay(2)"
or does it have to be "_level93.instancename.gotoAndPlay(2)"
just wondering!
thanks a million!
Targeting AttachMovie Clips.
Hey Everyone,
Making an XML news reader based off of senocular Squirrel XML news.
I'm using Fuse and wanted to target the dynamic text and or background portions of the headline section.
However, this movie clip is attached to the menu_mc so I'm stumped as to what I should exactly target for the fuse sequence (or any mx.transition/zigo engine based code-tweening process for that matter).
I've attached the files in a .zip for people to look at (and possibly conquer my problem!)
Thanks!
http://www.beepiams.com/XML%20News.zip
Targeting Clips On Layers
http://www.pyroblue.com/test/marcomm/home.html
Theres the example to work with....anyway....as you can see, im loading in movies externally...each on its OWN different level....what i want to do is make it so that when i click a menu option on the left, the current swf loaded on the stage closes and the new one comes up (to avoid the clutter of 10 differnt windows all scattered).....here are my thoughts:
1. have variables on the root timeline that are basically "currentLoaded" and "currentLevel" -- which basically will store the name of the currently loaded swf and the level that its on.
2. each swf would have code on frame one that would see if the 'currentLoaded' varible is blank, and if not...it will close the current loaded swf ....
my dilemma is that i dont know how to change the level dynamically...i know you could do the instance name like this:
_level39[currentLoaded].gotoAndPlay("crumple") ;
but how do i dynamically change the level?
would it look like this? [currentLevel][currentLoaded].gotoAndPlay("crumple") ;
++++++++++++++++++++++++++++++++++++++++++
AND ONE MORE question...if i load things into all sorts of different levels and each with their own instance name....how do i access those objects? do i even need to worry about targeting the level?
could i use just like "instancename.gotoAndPlay(2)"
or does it have to be "_level93.instancename.gotoAndPlay(2)"
just wondering!
thanks a million!
Help Targeting Movie Clips
I'm hoping someone can help me out. I have one scene with two movie clips (both are instances in frame one of scene one). Is something wrong with my syntax below, because when I change the value of "x" it's not going to the correct frame in the movie clip. Thanks!
x=3
if (x=1) {
_root.clipone.gotoAndPlay(15);
} else if (x=2) {
_root.cliptwo.gotoAndPlay(5);
} else if (x=3) {
_root.cliptwo.gotoAndPlay(20);
} else {
stop();
}
Targeting Movie Clips With Variables
Hi, This has been driving me nuts... i'm currently working on a movie in which you can duplicate objects (movie clips) by pushing a button. these objects are all the same movie clip, but each frame contains a different symbol (i.e., a different object)...
My problem is that when you duplicate the movieclip, i need it to immediately go to the same frame as the parent movie clip. I've tried setting variables based on the _currentframe property, (and then using tellTarget when you duplicate the new movie clip), and that works fine until the button that duplicates the movies resides in a movieclip... i'm assuming that my problem is that when you tell target an expression (to target a movie who's name corresponds to a variable) within a movie clip the variable's location is what's targeted, not the actual location of the movie clip as well... I'm sorry this is so difficult to explain, but i guess if anyone knows of a way to target a movie clip that's named by a variable from within another movie clip, that'd be really helpful...
i was able to work around it by adding an action to the movieclips to set themselves to a variable using the _onload command... that works, but it'd be nice to know if it was possible to do it the other way...
thanks a bunch,
roland
Targeting Duplicated Movie Clips
Hope someone can help me. I'm trying to target individual MC's that are inside duplicated MC's generated by an array. Is this possible?
thanks for any help!
Ray Boehmer
E-Learning Developer
Cisco Systems, Inc.
Targeting Multiple Movie Clips
Maybe this is a dumb question, but is there a way to change the properties (specifically _alpha) of multiple instances at once?
Here's my situation. I'm making a map, and there are 188 instances, which all fall into 4 categories. I use a naming convention of category + number. When I click on a category, instead of changing the alpha for 50 or so isntance, I'd like to hit them all at once. Is that possible?
Targeting Embedded Movie Clips
How do I go about targeting a movie clip that is embedded inside of another, from clicking on a button in a seperate movie clip! phew.... does that make sense? thanks.
Targeting Movie Clips Headache
Hello, please help...
I have a MC "whitecross" sat within another MC "explodingtxt" and would like to alter the rotation and visibility on rolling over a button (also inside MC "explodingtxt".) I am using the script (which doesn't work):
on (rollOver) {
setProperty ("whitecross", _rotation, 15);
setProperty ("whitecross", _visible, true);
}
Also, how would I target the clip if it were sat inside scene 1 (top level)?
Sorry for being a bit simple...
Targeting Masks That Are Movie Clips?
Targeting masks that are movie clips???? can this be done. Need to move the masked area of a movie clip when the mouse is in certain areas. The masked area is itself a movie clip. Doesn`t seem to be working but dont know that is because I`ve made a mistake somewhere or its not possible.
yours confused
ash
Targeting Duplicated Movie Clips
So I'm using the following actionscript to duplicate a movie clip 50 times:
i++;
duplicateMovieClip ("_root.flower", "flower"+i, i);
Is there a way to target these clips?
Basically what I'm doing is duplicating a movie clip of a flower-like object. Then, when it's been duplicated 50 times, I want to wipe the stage clean of all duplicated clips and start again. What can I do to remove all of these movie clips?
Targeting Movie Clips Using Variables
Hi!
I am currently putting a small game together for viral marketing purposes, and am having a little difficulty targeting a movie clip dynamically.
I need to use a variable as part of the target string.
For example:
_root.targetplayer = mike
then in the button, in a movie clip,
on (release) {
with (("_parent." add _root.targetplayer)) {
gotoAndStop("tackle");
}
}
the aim obviously being for the button to target the movieclip: _parent.mike
I have been unable to get this to work, and it's beginning to drive me nuts! i can only assume i am going about it the wrong way, and as a designer i would really appreciate a programmer offering a little advice!
the question can be summed up once more, as:
how can i target a movieclip without explicitly stating the location of the movieclip, but by using an expression as the target
thanks!
gavin
Targeting M-clips Inside ScrollPanes
Hi
I'd like to know if there is any way to give a movie clip loaded into a scroll pane an instance name - so you can target objects inside it from other parts on the stage?
I've got a movie clip "Script Boxes_mc" made up of text boxes with the Scroll Bar component attached to each.
This movie clip "Script Boxes_mc" is loaded into a Scroll Pane Window via the linkage ID in the Library. [ linkage ID is also "Script Boxes_mc" ]
the Movie clip loads "Script Boxes_mc" fine but without the scrollbars attached to the text boxes.
I've tried targeting the text box from the scroll bar componet through the parent clip eg. ScrollPane_mc.Script Boxes_mc.textboxA
But I havent obviously named the instance of "Script Boxes_mc" that is loaded into the Scroll Pane.
Is there a way to do this, or is there something else going on - like problems embedding components within others??
Hope this makes sense! I'll keep on truckin with it anyway!
Cheers
Robyn
Targeting Duplicated Movie Clips
anyone know how to do this....i've been trying really hard and failing.... pleeeeease help someone...i want to target a movie clip("grow") inside some of the duplicated movie clips and tell it to play...
on(keyPress"i"){
//variables
b = random(12);
i++;
a = "leaf" + i
//dupposition
_root.leaf.duplicateMovieClip(a,i);
_root.leaf._y = ypos[b]
_root.leaf._x = xpos[b];
}
on(keyPress"i"){
_root.leaf1.grow.gotoAndPlay("fall");
}
Targeting Frame Labels In Other Clips
I have a button in one movie clip with an on release action that is suppose to play a certain frame label in another movie clip.. I guess what i'm asking is what is the code I need to target that specific clip, and that specific label that is in another clip..They are both on level0. Here is the code I have now that works when the button is in the movie clip that has the frame labels in it, and that works fine.
on (release) {
gotoAndPlay("about");
}
Mike
Targeting Frame Labels In Other Clips
I have a button in one movie clip with an on release action that is suppose to play a certain frame label in another movie clip.. I guess what i'm asking is what is the code I need to target that specific clip, and that specific label that is in another clip..They are both on level0. Here is the code I have now that works when the button is in the movie clip that has the frame labels in it, and that works fine.
on (release) {
gotoAndPlay("about");
}
Mike
Targeting Dupplicated Movie Clips?
Hey there.
I am modifying a flash interface, the classix side scrolling one that increases in velocity depending on how far to the edge of the stage ou go on either side.
It works by duplicating the button many times. This is all fine, but how do i now add specific rollvoer actions to these duplicates since they are not actually on the stage where i can edit them?
Not sure how to approach this.
let me know if you do!
thx!!
Stevie Spin
Targeting Dynamically Named Clips
I am having trouble getting the following code to behave:
for (var n=0; n<xmlDoc_xml.firstChild.childNodes.length; n++) {
pref_pane.attachMovie("prefs_thumb_holder", "thumb" + n, n);
target = pref_pane.getInstanceAtDepth(n);
target_x = "desktop" + n + "_x";
target_y = "desktop" + n + "_y";
target._x = target_x;
target._y = target_y;
}
The problem is in the last two lines. If I replace the value of, say, target._x with desktop0_x it works fine, but I don't seem to be able to use the value of the target_x variable in its place like I would like. Can someone help me figure this out? Thanks!
Targeting Timelines Of Movie Clips
I have three movie clips of a star twinkeling all referring to a base movie clip animation. What I need is to control the timing of each one so that they dont all twinkle at one. I have tried to control the way they play by targetting them in all different ways but can seem to manage it.
Also they all need to start staight away but at different points along the animation.
It is driving me nuts any help would be fantastic thanks
Targeting Duplicated Movie Clips
I'm duplicating a movie clip using the following code:
i = 1;
do{
my_mc.duplicateMovieClip("my_mc" +i,i);
i++;
}while (i < 50);
The next thing I want to do is line them all up side by side, so what's the best way to target all the duplicated movie clips so I can re-set their _x and _y coordinates?
Sorry if there are loads of posts on this already but my browser kept timeing out every time I tried to search.
Many thanks.
Targeting Frames Within Movie Clips
Greetings,
I am using Flash MX 2004 professional
I need some help with a project.
I have a root timeline that contains 2 frames. Each frame is labeled and in each frame there is a movie clip.
Within each movie clip I have two buttons. One to move forward on the root timeline and one to root backward on the main timeline.
What I want to be able to do is go from inside one movie clip (the one on frame 2 of the root timeline) to a specific frame inside the movie clip that is placed on frame 1 of the root timeline.
I tried to label the specific frame within movie clip 1 (frame label "slide1" on the root timeline) with the name "backslide" and then in movie clip 2, I used this script at the end of that movie clip timeline:
_root.gotoAndPlay("slide1","backslide");
This did not work. I tried a number of different ways but either it would just go to the beginning of slide 2 and play it over again or it would go to slide 1 and start from the beginning rather than from the frame I wanted it to start at.
Is there a way to do what I am trying to do?
thanks for your help
peace
cc
<><
[F8] Targeting Nested Clips In AttachMovie
Hello...
So I need some help. I have a photo gallery menu. It has 4 options. Each option contains a different amount of photos. I have a dynamic text box that shows the number of photos for that menu option and buttons that are SUPPOSED to advance the photos. I've grouped all these (the text field and buttons) into one movie clip. I want that movie clip to attach itself to each menu option upon the menu option being clicked. It attaches fine. The number of photos for the menu display correctly but the buttons (which are really movieclips with a _btn extension) don't work! I could really use a fresh pair of eyes. I am inserting what I have for this.
I've labled the linkage of the movieclip properly, as "navi." Everything is spelled right, I just don't get it. ...and like i said the dynamic text field is showing properly, so not sure why the same target isn't working for the buttons. Thanks in advance.
pos_txt = the dynamic text field
next_btn = the movieclip thats supposed to advance the gallery
previous_btn = the mc thats supposed to go backward in the gallery
init = function(){
digi_mc.moveY(102, 3);
installation_mc.moveY(129, 3);
photography_mc.moveY(156.3, 3);
photography_mc.attachMovie("navi", "nav_mc", 1);
}
init();
//////////////////////////this part works fine - pos_txt is being found////////
function picture_num() {
current_pos = p+1;
photography_mc.nav_mc.pos_txt.text = current_pos+" / "+total;
}
/////////this isn't working even though it's in the same place as pos_txt//////
photography_mc.nav_mc.previous_btn.onRelease = function() {
prevImage();
}
photography_mc.nav_mc.next_btn.onRelease = function() {
nextImage();
}
///////////////////////////////////////////////////////////////////////////////////
function nextImage() {
if (p<(total-1)) {
p++;
photo_mc.loadPhoto(image[p]);
desc_txt.text = description[p];
picture_num();
}
}
function prevImage() {
if (p>0) {
p--;
photo_mc.loadPhoto(image[p]);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
photo_mc.loadPhoto(image[0]);
desc_txt.text = description[p];
picture_num();
}
[F8] Targeting Movie Clips Within Components
I've got a component which draws maps. I am able to provide custom maps in the form of movieclips with the map image dropped into the clip. The component has a parameter which allows you pass in the value of the custom map clip. I wish to have several different maps available, each stored on a different frame in the custom movieclip.How can I change the code so that by clicking on buttons I'm able to change the frame number of the custom movie clip which is added dynamically to the component?
The custom clip is added using attachMovie to an EmptyMovieClip, therefore it does not have an instance on the stage, just a name. How do I target it?
I'm using Flash9 with AS2 for compatability.
[f8] Targeting Individual Movie Clips
Hi,
I'm making a demo movie that contains several Movie clips that animate down the stage and contain a button with an over state and a nested movie clip for a text effect.
I want to target the individual Movie clips so that they Stop movement on MouseDown and Play on MouseUp.
The code is as follows:
I can accomplish it for one Movie clip, but the action also affects the other clips simultaneously.
How do I discreetly address the individual Movie clips without affecting the others?
Thanks ahead of time for the help.
[f8] Targeting Individual Movie Clips
Hi,
I'm making a demo movie that contains several Movie clips that animate down the stage and contain a button with an over state and a nested movie clip for a text effect.
I want to target the individual Movie clips so that they Stop movement on MouseDown and Play on MouseUp.
The code is as follows:
onClipEvent (mouseDown) {
this._parent.TAPmover.TAP.onMouseDown = function(stop) {
};
stop();
}
onClipEvent (mouseUp) {
this._parent.TAPmover.TAP.onMouseUp = function(play) {
};
play();
}
I've attached the .FLA for review.
I can accomplish it for one Movie clip, but the action also affects the other clips simultaneously.
How do I discreetly address the individual Movie clips without affecting the others?
Thanks ahead of time for the help.
Targeting Nested Movie Clips
I have a menu that attaches movie clips to an empty holder movie clip on the stage. Using this code:
Code:
this.button1.onRelease = function() {
var swapthedeck:String = "mc1";
_root.attachMovie(swapthedeck, "holder", 20, {_x:1, _Y:1});
enableAll();
this.gotoAndPlay("_clicked");
this.enabled = false;
}
In another area, I'm trying to find that movie clip that was loaded into holder for use in another script. I am currently using this:
Code:
this.control1.onRelease = function() {
control1.gotoAndPlay("_clicked");
var mcInstance:MovieClip = _root.getInstanceAtDepth(20);
trace (mcInstance);
}
However, when I trace the mcInstance, it returns "_level0.holder". This is the right name for the holder, but not the movie clip that was loaded inside of it. Does anybody know how to harvest the name of the movieclip that is present within holder? Any help is greatly appreciated. Thank you.
Rich
Targeting Movie Clips And The 'if' Statement?
Hi,
does anyone know why the code at the bottom isnt working(the stuff about the mc_bg's...gotoAndPlay ("off")...and ("on")...etc)
- the code is on first frame, main timeline
- all mc_bg's are on seperate layers on first frame, maintime line
Thanks!
Code:
stop();
//setup start stage
var main_selection:Object = null;
_root.waitMC._visible = false;
//setup main buttons
var mcs:Array = new Array("reel", "things", "links", "contact");
for (var i:Number = 0; i<mcs.length; i++) {
var mc:MovieClip = this["mc_"+mcs[i]];
mc.id = i;
mc.onRelease = function() {
if (_level0.main_selection != this) {
_level0.main_selection.enabled = true;
_level0.main_selection.gotoAndPlay("wait");
_level0.main_selection = this;
_level0.preloader.gotoAndPlay(1);
_level0.preloader.gotoAndPlay(2);
_global.containerMC = _level0.containerMain;
_global.containerMC.loadMovie("chapters/"+mcs[this.id]+".swf");
this.enabled = false;
}
};
mc.onRollOver = function() {
this.gotoAndPlay("over");
};
mc.onRollOut = function() {
this.gotoAndPlay("wait");
};
}
if (main_selection=mc_reel) {
this.mc_bg01.gotoAndPlay("on");
this.mc_bg02.gotoAndPlay("off");
this.mc_bg03.gotoAndPlay("off");
}
if (main_selection=mc_things) {
this.mc_bg01.gotoAndPlay("off");
this.mc_bg02.gotoAndPlay("on");
this.mc_bg03.gotoAndPlay("off");
}
if (main_selection=mc_links) {
this.mc_bg01.gotoAndPlay("off");
this.mc_bg02.gotoAndPlay("off");
this.mc_bg03.gotoAndPlay("on");
}
|