Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Targetting Button Inside Attached Movie


I have a button (buttonA) inside a movieclip (clip1)
"clip1" is attached to an empty clip (emptyclip)on _root at runtime
_root.emptyclip.attachMovie("clip1", "clip1", 0)
Now I know that I can target "clip1" for example to change it's colour using _root.emptyclip.clip1 but how do I target buttonA (which is inside clip1)
ButtonA inside clip1 has an instance name of "buttonA" and is also selected for export in first frame with a linkage name of "buttonA"
I tried this, just to see if it would work
_root.emptyclip.clip1.buttonA.onPress = function(){
trace("button pressed")
}
but it didn't work!
I assume that there is a problem with targetting, but I just can't see what is wrong

JennyJ




FlashKit > Flash Help > Flash ActionScript
Posted on: 05-20-2003, 04:50 PM


View Complete Forum Thread with Replies

Sponsored Links:

Targetting Attached Movie Clips
Hi , hope someone can fix this, it's prolly something rather simple , but I'm blinded by the simplicity

Roughly got this code (edited for viewing pleasure):


Code:
for (i=0; i<5; i++) {
planet=attachMovie("star", "mc_star"+i, 100+i);
}


now , after this for loop , let's say , I want to call the third attached star and set it to invisible ... how do I call it ?


Code:
planet["mc_star" + 2]._visible = false;


doesnt seem to do the trick.

View Replies !    View Related
Targetting And Positoning A Concatenated Attached Movie
Sorry funny title but wern't sure what else to call it!

What I'm trying to do is use attachMovie to attach a linked movie (in which there is a dynamic textfield and another movieclip) several times. So i set up a loop and I want to add these attached movies to the stage one underneath the other. my problem is once ive created the mc how do i position it?

Iv attached a file for anyone who wants to be the first to point out my stupidity!

Thanks for your time

View Replies !    View Related
Targetting MC Inside Button
I have a movie clip inside a button inside a movieclip like this :


Code:
<_level0>
<mc1>
<button1>
<mc2/>
</button1>
</mc1>
</_level0>


note: that is not XML, just a logical way of looking at the object structure I have.

My question is, how can I target MC2 that is nestedf within a button?

I've tried _level0.mc1.mc2 but it does not work ! Any advice gratefully received, thnks

View Replies !    View Related
Having Trouble Targetting A MC Inside A Button
I have a button object with a simple, 2-frame movie clip in the Up state. My button is called productsButton and the movie clip is called productsMC. I'm trying to write an ActionScript in which the movie clip should goto and stop at the frame labelled "on" on release of the button. But for some reason, I can't seem to target the movie clip. Here's the script:


Code:
productsButton.onRelease = function() {
_root.productsButton.productsMC.gotoAndStop("on");
}


This doesn't work, and when I try to use the "Insert a target path" feature of the Actions pane, productsMC isn't listed. What did I do wrong?

View Replies !    View Related
Targetting Inside A Loaded Movie Clip
Hello all, here's what I'm trying to do:


Code:
loadMovie("test.swf", mcBox);

if(mcBox.box.hitTest(mcDot)){
trace("it hit")
}
Basically what I'm trying to do is load a swf into a movieclip, and then run a hit test on a movieclip within that loaded movie. It doesn't feel that targetting individual instances within loaded swf's is working, even though it will trace a valid pathway.

Any comments?

View Replies !    View Related
Targeting Button Inside Attached MC
If I've got an invisible MC on the main timeline with the instance name "invisMC" and I've attached a MC and created the instance name "attachedMC" and that MC contains a button with the instance name "yesButton". Can I target that button from the main timeline. The route I tried didn't work. This is what I thought:

Code:
_root.invisMC.attachedMC.yesButton

View Replies !    View Related
Targetting Attached Movies
[Flash 8]

Hi,
I attached some movies based on an array pulled from an XML file. eg.

for (var k=0; k < accountArray.length; k++){
var thisAcc:MovieClip = _root.ledgerContent.attachMovie("accLedger_mc","ac countMC"+k,_global.cDepth);

Now I want to do a hitTest on each of them when a dragged movieclip is released. How do I put a variable into a target path so that I can create a loop for the length of the array? eg.

for (e=0; e < accountArray.length; e++){
if (draggedLoc == null){
if (ledgerContent.accountMCe.credit.hitTest(_root.dragable1.dragBut)) {
draggedLoc = "credit";
trace ("Dragged to "+accountArray[e][1]+" - credit");
} else if (ledgerContent.accountMCe.debit.hitTest(_root.dragable1.dragBut)) {
trace ("Dragged to "+accountArray[e][1]+" - debit");
draggedLoc = "debit";
} else {
draggedLoc = null;
}
}
}

The above doesn't work of course.

View Replies !    View Related
Targetting Attached Movieclips
Hey guys,

I did a search on the forums and found 2 threads that were relevant but didn't quite get what i wanted out of them.

I've loaded a movieclip using attachMovie(); and ive put it into an empty movie clip (as you would with external MC's)

So my AS reads:

attachMovie("identifiername,"newname","emptymoviec lip");

My question is how i will go about targetting the loaded movieclip and having it play a certain frame.

I tried:

_root.emptymovieclip.gotoAndPlay(2);

and

_root.attachMovie("box","box","holder").gotoAndPla y(2);

(stab in the dark ).


Thanks in advanced guys.

View Replies !    View Related
[F8] Buttons Inside Movieclip Used As A Button Too, HELP Archive Attached
Hi guys, I've been figuring out for 2 days how to workaround the way to make that menu work. But my knoledge of AS it's not really advance.

I have created a menu like that I have a main movieclip, that contains an animation and buttons inside, but that main movieClip has ab onRollOver and onRollOut function. The thing is I dont want to use invisible buttons or movieclips over the movie to activate it, I want to try to do everything as a block or in the same mc, to can reuse without adding stuff over.

Thank You.

Attached File

View Replies !    View Related
GotoAndPlay Inside An Attached Movie?
Hi all,

I am trying to get gotoAndPlay working on buttons I have within a movie clip that has been attached to my scene.

Currently what happens is you click on a button on the main timeline which uses attachMovie to load up another movie clip into my "loader_mc" movie clip. The attached movie is called 'models' and I have its' linked name set to 'models_page'.

I have buttons inside 'models' that I would like to be able to click on and they will go to a certain frame inside the 'models' movie clip. I have tried using


Code:
on (release) {
_root.loader_mc.gotoAndPlay(10);
}

as well as things like


Code:
on (release) {
_root.models.gotoAndPlay(10);
}


but none of it seems to work. I can use _root.gotoAndPlay(10); and the movie will go to frame 10 on the main timeline like it should, but I cannot get it to go to a certain frame inside the attached movie.

I haven't uses attachMovie very much, so am I missing something, or not linking to the attached clip properly?

Thanks,

Scott

View Replies !    View Related
Instances Inside An Attached Movie.
How do I manipulate an Instance inside an attachedMovie ?

For example, I create an createEmptyMovieClip and attach a Movie to it. The movie attached to it has an instance called mc_mask and I want to move that instance from outside that movie (from where I created the empty clip).

This dosn't seem to be an issue with loading external SWF, with attached Movies it seems to be differen.t

View Replies !    View Related
Instances Inside An Attached Movie.
How do I manipulate an Instance inside an attachedMovie ?

For example, I create an createEmptyMovieClip and attach a Movie to it. The movie attached to it has an instance called mc_mask and I want to move that instance from outside that movie (from where I created the empty clip).

This dosn't seem to be an issue with loading external SWF, with attached Movies it seems to be differen.t

View Replies !    View Related
Targetting Attached Movieclip Question
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:

decrement and increment are two functions
/////////////////////////////////////////////////////////////////////////

ThisItemNumber.onRollOver = function() {
this.but1_1.Decrement(50, 2);
};
ThisItemNumber.onRollOut = function() {
this.but1_1.Increment(100, 2);
};
//////////////////////////////////////////////////////////////////////

this doesnt work
//////////////////////////////////////////////////////////////////////

ThisItemNumber.onRollOver = function() {
var WichButOver = ["but1_"+this.numbr];
this.WichButOver.Decrement(50, 2);
trace(WichButOver);

//trace = but1_1 if you rollover but 1
//trace = but1_2 if you rollover but 2
};


ThisItemNumber.onRollOut = function() {
var WichButOver = _root["but1_"+this.numbr];
this.WichButOver.Increment(100, 2);
trace(WichButOver);

//trace = but1_1 if you rollover but 1
//trace = but1_2 if you rollover but 2
};

hopefully yall know what i'm talking about....
tnx in advance...

desperado redg

View Replies !    View Related
Targetting Attached Movieclip Question
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:

decrement and increment are two functions
/////////////////////////////////////////////////////////////////////////

ThisItemNumber.onRollOver = function() {
this.but1_1.Decrement(50, 2);
};
ThisItemNumber.onRollOut = function() {
this.but1_1.Increment(100, 2);
};
//////////////////////////////////////////////////////////////////////

this doesnt work
//////////////////////////////////////////////////////////////////////

ThisItemNumber.onRollOver = function() {
var WichButOver = ["but1_"+this.numbr];
this.WichButOver.Decrement(50, 2);
trace(WichButOver);

//trace = but1_1 if you rollover but 1
//trace = but1_2 if you rollover but 2
};


ThisItemNumber.onRollOut = function() {
var WichButOver = _root["but1_"+this.numbr];
this.WichButOver.Increment(100, 2);
trace(WichButOver);

//trace = but1_1 if you rollover but 1
//trace = but1_2 if you rollover but 2
};

hopefully yall know what i'm talking about....
tnx in advance...

desperado redg

View Replies !    View Related
Wait Loading Inside The Attached Movie
Hi everyone!

Im attaching lots of movies in to empty clip in a for loop.like this


Code:
...
for (i=total-1; i >= 0; i--) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
creatPage(i);
}
AFUNCTION_AFTER_FOR();
...
function creatPage(j){

mclips[j] = _root.ana.attachMovie("gana", "gana"+j , ana.getNextHighestDepth());
mclips[j].mc.loadMovie(image[j]);
}


As you can see i also load something into the clip that i attached. So i creat lots of attached movies and load images into MCs inside the attached movies.

The problem is that , i want the AFUNCTION_AFTER_FOR() wait, untill all mcs in all attached movies loaded.

I thinking of using counters for loaded movies..and somemore things but.. i cant come up with an exact solution, and i also searched the web, im sure there must be at least one more person in the galaxy who comes up with this problem but i couldnt find him on web.

So anyone has idea?

Thnx alot.

View Replies !    View Related
Dynamic Attached Button_mc + Targetting Proper Value
Hi once more

so i've managed to get flash building up a menu that reads from a xml file
it nicely attaches buttons for the amount of nodes i want to be shown
(11 in this case) it will change over time, and i don't feel like recoding every button behavior everytime the menu needs to get updated, cheers for dynamic...

all the names are filled in nicely, but 1 thing is missing and i can't find out where my mistake could be.
i've spent over 3 days now, fiddling around with the code, yet nothing works, or works half...

here is the deal:
ps the theName_str is is "masked" for obvious reasons

Code:
var i:Number;
var theName_str:String = "/place/to/look/for";
var name_array:Array = XPathAPI.selectNodeList(this.firstChild, theName_str);
for (i=0; i<name_array.length; i++) {
var SB = attachMovie("sub", "buttonsub"+i, i);
SB.btntxt.text = name_array[i].firstChild.nodeValue;
trace(" "+i+"."+name_array[i].firstChild.nodeValue);
SB.onRelease = function() {
trace(" "+i+"."+name_array[i].firstChild.nodeValue);
}
}
so this in the output gives me nicely all the values i want in the button textfields.

yet if i press a button , the output gives me something like

Code:
SB.11 undefined
11 stands for the amount of nodes that is being loaded.

when i change the code to

Code:
SB.onRelease = function() {
trace(SB + "."+name_array[i].firstChild.nodeValue);
this traces in the output... it's very confusing for me at this point


Code:
_level0.SB10.undefined
so i'd like to know how i could trace for example when i press the third button, it says SB.03 name of the corresponding node

so in other words SB.03 in the textfield says kirupa
how do i trace when i click on it "sb.03 kirupa"

i hope this is well written for someone to understand, my english isn't that well. is there anyone here that wishes to guide me? much appreciated

kind regards
triss

View Replies !    View Related
Swaping Attached Movies Inside A Blank Movie Clip?
I have a blank movie clip at:

_root.placeholder

I want to click a button and load a movieclip from my library into it.

Any Ideas?


Frequent-C
http://www.Freq-Fest.com

View Replies !    View Related
How To Have A Button Link To A Certain Frame Inside A Movie Clip From Inside A Movie
Is this possible? I have a menu and would like to have a drop down box nested inside the menue which links to certain frames inside the main movie clip.

View Replies !    View Related
Targetting A MC Inside A Swf
hi all!

its very simple:

im loading a swf file ("content.swf") in my main flash file (main.fla)

in the content.fla i placed a movieclip and gave it an instance name: "m_mc"

so

how can i (for instance) stop the m_mc from the "main.fla" file????

is it possible?


hope what im trying to do is clear

thanks in advanced?

View Replies !    View Related
DuplicateMovieClip- Targetting MCs Inside Other MCs
Hi there, I would like to duplicate a movieClip that exists in a SWF that has been loaded into the main movie and place this duplicate into a different SWF that is loaded intop the main movie. I am not sure if this is possible and can't get this to work.
I have made a simple movie with 2 movieclips and the code inside of one of the boxes tries to duplicate the other movieclip using this code:

ActionScript Code:
duplicateMovieClip(_root.my_mc, "my2_mc", 2);my2_mc._x += 100;

As I say I'm not sure I can target MCs in that are not on the same level as the function is called from, if somone could advise me a way to do this it would be really handy.

Thanks for any suggestions guys!
Schm

View Replies !    View Related
Button Inside Movie Clip Inside Scrollpane Doesn't Work In Xml
This is sorta odd but I'm hoping somewhat easy to fix. This is in AS2 and is the last problem I have in a very small project of mine.

I have button called button01 inside a movieclip called movieclip01 which is the contentPath for a scrollpane called scrollpane01. I'd like the button to work, and depending on the code it will work in the normal .swf but won't when I embed my movie into xml.

If I put the code inside movieclip01

button01.onRelease=function(){
_root.gotoAndPlay("Frame Name");
}

It will work when I test it but not in the XML. So what I want to do is go to the main timeline where the scrollpane is and write the code there. That is where I'm stuck.

I've tried scrollpane01.movieclip01.button01 and tried movieclip01.button01 and also tried scrollpane01.button01. Just for giggles I also tried scrollpane01.movieclip01 but none of that works

Last night I had a similar problem with buttons inside a movieclip that was on the root stage. They worked in the swf but not when I embedded the file - so I found this which worked (typed in the root stage)

movieclip01.button01.onRelease=function(){

View Replies !    View Related
Behavior On Buttons Inside A Movie Clip Inside A Button.
I would like t create an animated button with menu inside, how do i do it.

something like on here http://www.demarchelier.net

hidden menu on left side (contents) but on flash. I have flash 8. any tutorial that explain how to do that ?

View Replies !    View Related
Targetting Dynamic Text Inside A MC
Hello - please help if you can.
I'm trying to change text in a dynamic field within a movieclip on a rollover action - but failing.
e.g. for a field 'mytype' in a MC 'myclip' I'm currently using:

mytype = "input text...";

which doesn't work - probably because Flash can't find the field 'mytype'. What do I need to do..?

Thanks in advance.
PM

View Replies !    View Related
Targetting A Clip Inside Loaded Swf
Hi

I need to target 2 movie clips inside an external laoded swf, from 2 buttons in the main stage. Dont know how to target them. Hotels.swf is the swf that has 2 clips inside it.

This is my code:

var mc_New = pinkie_mc.createEmptyMovieClip("abcd", 1);
mc_New._x = 100;
mc_New._y = -120
mc_New.loadMovie("hotels.swf");

Thanks
Koosha

View Replies !    View Related
Targetting Frames Inside Loaded Swf
Sorry for asking this again:

I have 5 buttons on the stage and have this code for each button + 5 external swf. (stacking swf on top of eachother when loaded to the stage).It works ok now

tot_mc.hotels_btn.onPress = function() {
var someDepth = empty_mc.getNextHighestDepth();
var mc_New = empty_mc.createEmptyMovieClip("hotelsup", someDepth);
mc_New._x = 500;
mc_New._y = 26.5;
mc_New.loadMovie("myMovie.swf);
trace(someDepth);
var mc_Target = empty_mc.getInstanceAtDepth(someDepth-2);
trace("mc_Target = "+mc_Target);
if (mc_Target != undefined) {
removeMovieClip(mc_Target);
}
};

It works ok now but I need to target a frame inside myMovie.swf. Dont need the whole swf to be loaded and want to have 2 clips inside "myMovie.swf" and target each of them seperatly from the stage buttons.

Thanks for your help
Koosha

View Replies !    View Related
Why Doesn't This Work... Targetting An MC Inside MC
Inside my mc btn1 I have another mc called 'arrows' but when I target it nothing happens, it's meant to fade _alpha to 0... Any ideas?


Code:
for (i=0; i<numOfBtn+1; i++) {
this["btn"+i].num = i;
this["btn"+i].onRollOver = function() {
this.play();
this.arrows.alphaTo("0", .5, "easeOutQuad", 0);
};

View Replies !    View Related
Why Doesn't This Work... Targetting An MC Inside MC
Inside my mc btn1 I have another mc called 'arrows' but when I target it nothing happens, it's meant to fade _alpha to 0... Any ideas?


Code:
for (i=0; i<numOfBtn+1; i++) {
this["btn"+i].num = i;
this["btn"+i].onRollOver = function() {
this.play();
this.arrows.alphaTo("0", .5, "easeOutQuad", 0);
};

View Replies !    View Related
[ ? ] Targetting Function Inside Imported SWF
Hi,

Is it possible to target function that's inside imported (or Loaded) swf
file?

I want to load external swf file into my fla project file, and then with a
press of a button (for example) trigger a function that's inside that
imported (or Loaded) swf file?


Thanks in advance!
Roman

View Replies !    View Related
Why Doesn't This Work... Targetting An MC Inside MC
Inside my mc btn1 I have another mc called 'arrows' but when I target it nothing happens, it's meant to fade _alpha to 0... Any ideas?


Code:
for (i=0; i<numOfBtn+1; i++) {
this["btn"+i].num = i;
this["btn"+i].onRollOver = function() {
this.play();
this.arrows.alphaTo("0", .5, "easeOutQuad", 0);
};

View Replies !    View Related
Why Doesn't This Work... Targetting An MC Inside MC
Inside my mc btn1 I have another mc called 'arrows' but when I target it nothing happens, it's meant to fade _alpha to 0... Any ideas?


Code:
for (i=0; i<numOfBtn+1; i++) {
this["btn"+i].num = i;
this["btn"+i].onRollOver = function() {
this.play();
this.arrows.alphaTo("0", .5, "easeOutQuad", 0);
};

View Replies !    View Related
Why Doesn't This Work... Targetting An MC Inside MC
Inside my mc btn1 I have another mc called 'arrows' but when I target it nothing happens, it's meant to fade _alpha to 0... Any ideas?


Code:

for (i=0; i<numOfBtn+1; i++) {
this["btn"+i].num = i;
this["btn"+i].onRollOver = function() {
this.play();
this.arrows.alphaTo("0", .5, "easeOutQuad", 0);
};

View Replies !    View Related
Button On Attached Movie
I have a button which calls in a movie which is attached to main movie. However there is a second button on the added movie which is then not recognised and does not work. Please can anyone help me to have this second button function.

Thanks in advance.

View Replies !    View Related
Tween Inside A Button Inside A Movie Clip
Say I have 3 squares, from left to right, blue, red, yellow. The 3 squares together are a MC that move from off the stage on right, across the stage to line up on the left. Now say I want to make the left blue square a button so that when you roll over it, it has a orange frame and then when you press down on it it dims, and a larger version of it shows up above it. how would I do this? What i've done so far is made a button inside the MC, then on the down state of the button made a graphic button for the blue square, but it doesn't stay dimmed, and I don't even know how to make the larger blue square appear.

Is this too confusing?
please help.
thanks

View Replies !    View Related
Targetting Buttons Inside Externally Loaded SWF
Im having trouble targetting a button named btn1_btn that is located in a movie clip called thumbs_mc. Im loading thumbs_mc into and emtpy movie clip called holder_mc. When i call upon btn1_btn to load Jpeg1.swf do i need to create a new movie clip? I created one for thumbs_mc already. Can i just load Jpeg1.swf into holder_mc? And how in the world do i target btn1_btn from the main movie timeline?

Heres the code im using in the main movie

level1.thumbs_mc.btn1_btn.onRelease = function() {
createEmptyMovieClip("picholder_mc", 1);
picholder_mc._x = 0;
picholder_mc._y = 0;
picholder_mc.loadMovie('Jpeg1.swf');
};

View Replies !    View Related
Targetting With Relative Paths Inside A Custom Class
Let's say i created a custom class of a movieclip:
code:
_global.newMovieClip = function () {
}
newMovieClip.prototype = new MovieClip();
newMovieClip.prototype.MoveTo = function findPath(x,y) {
this._x = x;
this._y = y;
}
Object.registerClass("mcEnemy",newMovieClip);

I'm currently working on a game where enemy clips are attached dynamically during the game.
I know that i can target the individual properties of each instance with this, and other timelines by using an absolute path root, but what if i want to target a timeline or variable relative to the path of the enemy clip? Enemy clips will be attached to different timelines and i want all these enemy clips to target other movieclips using a dynamic relative path?

is that possible?

View Replies !    View Related
Button In An Attached Movie Clip Won't Work
I have a Movie Clip in my library called "Attachment". On the timeline for Attachment, there's just one frame, with some artwork and a button that goes to Frame 10 of the parent scene.

When I use the attachMovie function, "Attachment" shows up but the button doesn't work. In fact, to be honest, it doesn't seem to respond to my clicks at all, so I'm assuming that the image of the button is there, but the button isn't work.

I should note the buttons on the movie clip are also in my library. Am I jumbling something up? Do I need to do linkage for the buttons in the library, or just linkage for the movie clip since that's what I'm calling?

View Replies !    View Related
Referencing A Button In An Attached Movie Clip
I am trying to code an onRelease function for a button located in a movie clip I've attached to another movie clip. It works for one button, but not for another, eventhough I think I've done them the same way. Here's the code:


Code:

his.stop();

//THIS PART WORKS
map_button_holder.map_anim_mc.btn_get_map.onRelease = function(){
map_holder.attachMovie("mapclip", "map_mc", map_holder.getNextHighestDepth());
map_button_holder.removeMovieClip("map_anim_mc");
map_button_holder.attachMovie("mapclose", "map_close_mc", map_button_holder.getNextHighestDepth());
trace("get map clicked");
}

//THIS PART DOESN'T WORK
map_button_holder.map_close_mc.btn_close_map.onRelease = function(){
map_holder.removeMovieClip("map_mc");
map_button_holder.removeMovieClip("map_close_mc");
map_button_holder.attachMovie("mapanim", "map_anim_mc", map_button_holder.getNextHighestDepth());
trace("close map clicked");
}
The movie clip "map_anim_mc" was attached (using attachMovie) to map_button_holder a few frames earlier, and btn_get_map works. Can anyone see what's wrong with my code, or what might be the problem?

View Replies !    View Related
Action Works Attached To A Button But Not When Attached To A Frame
can anyone tell me why the following button script works:

on (release) {
_root.welder.eyes.gotoAndPlay(2);
_root.welder.gotoAndPlay(2);
}

but this virtually identical script won't work in a frame (on the same timeline as the button):

_root.welder.eyes.gotoAndPlay(2);
_root.welder.gotoAndPlay(2);

i've been pulling my hair out all day over this. i can't think of an explanation as to why the second example wouldn't work. its baffling to me.

View Replies !    View Related
Button/ Floating Movie Clip Attached To Mouse
How do I add a movie clip attached to mouse movement when a button is rolled over? Help Please

View Replies !    View Related
Applying Dynamic Functions To A Button Nested In An 'attached' Movie
I can't get this to work.

I'm attaching several movie clips from my library. Within each clip is a button. I need to assign a function to each button when the clip is attached - but the functions will be slightly different for each button. E.g. I want flag1.flag_button to display the flag1.title_text on rollover.


Code:


_root.tiles.attachMovie("flag_pin", ("flag" + k), (_root.depth));

eval("_root.tiles.flag" + k)._x = x;
eval("_root.tiles.flag" + k)._y = y;

eval("_root.tiles.flag" + k).title_text.text = eval("_root.sites.site" + k + "_title");

eval("_root.tiles.flag" + k).flag_button.onRollOver = function () {

title_text._visible = true;
}

eval("_root.tiles.flag" + k).flag_button.onRollOut = function () {

title_text._visible = false;
}



Thanks,

View Replies !    View Related
Loading Multiple Movie Clips Using MovieClipLoader Script Attached To A Button State
I am building a site that loads both images(using moviecliploader) and text(using loadvars.load) dynamically to a stock page(mytarget is on level5) when different buttons are pressed. My problem is that when I program a function to a button state to call more than one item it does not work.

For examle

code:
Mybutton.onRelease = function(){
myMovieLoader.loadClip(“mytarget.swf”,5); //loads the swf that has the text and image targets
myMovieLoader.loadClip(“image1.jpg”,_level5.imaget arget); //loads image to target MC on level5
myLoadVars.load(“mytext.txt”); //loads the text using myLoadVars to level5.sitetext
}


So, this does not work. If I delete any two of the lines of code it will work. The image load will work independently, the load vars will work independently, and the moviecliploader works independently.

So as a temp solution I have separated out the lines of code to different mouse actions. This does work but looks like crap because the text does not come up till the user rolls off the button, which can only confuse them.

Example

code:
Mybutton.onPress = function()[
myMovieLoader.loadClip(“mytarget.swf”,5); //loads the swf that has the text and image targets
}

Mybutton.onRelease = function(){
myMovieLoader.loadClip(“image1.jpg”,_level5.imaget arget); //loads image to target MC on level5
}

Mybutton.onRollout = function(){
myLoadVars.load(“mytext.txt”); //loads the text using myLoadVars to level5.sitetext
}


SO how would I call the moviecliploader to load...say 3 movies to different levels just by pressing a button?

EDIT: Added [ as ] tags - jbum

View Replies !    View Related
Button Inside Movie Inside Button
Ok, i hope someone can help coz im stumped.

I have a button which plays a movie clip on rollover. The movie plays outside the buttons hit state and has a further button within it.

My problem is that whenever i roll out of the original button to press the new button within the movie clip i am outside the original buttons hit state so the movie vanishes.
I cant extend the original buttons hit state as i have 8 buttons close by which would interfere with each other and i also only want the rollover to work on a small area.

Any ideas how i can maybe change the hit state once the movie has played??
Or any other ideas.

Thanks

View Replies !    View Related
Attach Inside Attached
one question.

i attach a movie from the library and it works fine ("mcA"). then i try to attach aother movie ("mcB") into "mcA" and that doesnt work fine.

question:
is it so that you cant attach a movie to an already attached movie?

TOYTOTA

View Replies !    View Related
Problem With Btn Inside An Attached MC
Hi!

I have a problem with an attached MC that I have but I can't figure out how to handle it.

Here's the deal, I have a MC with some dynamic text, a mc container and button.
The swf attachs as many MC says a variable that is on an .txt file.

Everything works ok, except, the part of the button. Here I attach part of the code so you can understand me:

i = 0
while (i <= (_root.variables.cantidad)) {
i++;
this.attachMovie("cuadro","cuadro"+i,i)
setProperty(this["cuadro"+i],_y,40*i - 40);
loadMovie("viejos/pequenas/img" add i add ".jpg",this["cuadro"+i].imagen);
this["cuadro"+i].marca.text = _root.variables["marca"+i]
this["cuadro"+i].equipo.text = _root.variables["equipo"+i]
this["cuadro"+i].referencia.text = _root.variables["referencia"+i]
this["cuadro"+i].yearr.text = _root.variables["yearr"+i]
this["cuadro"+i].img.text = _root.variables["img"+i]
_root["ulr"+i] = "javascript:openWindow('" add "viejos/img" add i add ".htm'," add "'myNewWindow', 'toolbar=0,location=0,directories=0,status=0,menub ar=0,scrollbars=0,resizable=0,width=500,height=350 ,left=40,top=90')"
this["cuadro"+i].btn.onRelease = function () {
trace(_root["ulr"+i])
}
}

When I click any of the buttons it always open the img10.htm (if I put for example on the .txt 10 as the required MC to attach, which is in the _root.variables.cantidad in the AS above). I need that each button opens img1.htm, the other img2.htm and so on, but it doesn't work. I can't figure out why if the rest of the elements (dynamic texts and images loaded) works ok.

Please somebody help me with this, I don't know what I'm doing wrong.

View Replies !    View Related
Can't Attach 2 MC's Inside Attached MC?
AS2

Code:
_root.attachMovie("container", "container", this.getNextHighestDepth());
////background image of a box

container.attachMovie("listx", "listx", this.getNextHighestDepth());
//mc containing 2 text fields
container.listx.titlex.text = "This is the 1ST title";
container.listx.descriptionx.text = "This is the 1ST description";
container.listx2._y = 0;

container.attachMovie("listx", "listx2", this.getNextHighestDepth());
//mc containing 2 text fields
container.listx2.titlex.text = "This is the 2ND title";
container.listx2.descriptionx.text = "This is the 2ND description";
container.listx2._y = 40;
This will only display "list2". If I comment out list2 then list1 will display. Can anyone show me how to do this properly and/or why this doesn't work? Any advice would be greatly appreciated!

View Replies !    View Related
Having A Button Inside A Movie Clip To Move The Root Movie To Another Frame?
i dont know much about actionscripting so explain to me in simple terms...

i have buttons inside a single movie clip and i want to have each button (when clicked or rollover-ed) move the frame header of the main (root) movie to another position. what actionscript does this require? and will each button actually be "clickable" since they're all encapsulated in ONE movie clip??


thanks

View Replies !    View Related
Setting CHOICE With MC That Is Inside Another MC - FLA Attached
i would be so happy to get some help on this...

my movie has movieclip buttons that set the root choice :

cdz.choice=1
cdz.onPress=setChoice;

function setChoice() {
menucd._visible = false;
choice = this.choice;
gotoAndPlay(2);
}


but now i want the cdz movieclip inside another mc (cdbuts), so i've changed the choice line to : _root.cdbuts.cdz.choice=1
but it is not working for me.

i tried tracing the button and the trace is showing up, but not functioning.



i've attached the FLA incase that helps...

thanks for any help anyone can possibly offer me, i'm going crazy

View Replies !    View Related
Access Mc Inside Dynamically Attached Mc? Please Help
I have an array of dynamically attached mc's, and I want to set text in a textfield that is inside movieclip that is inside each one of the attached mc's. I keep getting this error:

TypeError: Error #1010: A term is undefined and has no properties.

Here is the part of my code I'm having problems with. The mc is "square," the mc inside of it is "thumbText_mc," and the textfield inside of that is "hoverText":


Code:
function createThumbs(){
var myXML:XML=new XML(xmlLoader.data);
for (var z:int = 0; z<(myXML.image.length()); z++){
var but:square = new square();
butContainer.addChild(but);
but.name = "button" + z;
butArray[z] = butContainer.getChildByName("button" + z);
butArray[z].x = (z*300);
butArray[z].y = 0;
butArray[z].buttonMode = true;
butArray[z].addEventListener(MouseEvent.CLICK, loadThumb);
var thumbs = butArray[z];
thumbs.num = z;
thumbs.thumbText_mc.hoverText.text = (myXML.image[z].@capTwo);
Thanks in advance

View Replies !    View Related
Move MC Attached And With A Swf Inside (loadClip)
Hi, i have a problem with this function

Code:
//insert the container, an empty MC
attachMovie("container","container",_level0.getNextHighestDepth());
container._x = 145;
container._y = 40;
//assign an onEnterFrame for it to follow the _y pos of another MC
container.onEnterFrame = function() {
this._y = _level0.scrollbar._y;
trace (_level0.scrollbar._y);
};

//if the MC container had have inside anything, like a circle, everything works fine until here, where i want next to load a swf movie inside this MC
//listener functions
var mclListener:Object = new Object();
mclListener.onLoadComplete = function(target_mc:MovieClip) {
_level0.charging_text.removeMovieClip();
};
//create a loader
var image_mcl:MovieClipLoader = new MovieClipLoader();
//assign the listener
image_mcl.addListener(mclListener);
//load the swf
image_mcl.loadClip("movie.swf",container);
for testing, i tryed all the script but the listener functions and it worked fine, but when i load the clip, neither the _y or the trace functions worked...
i mean, the onEnterFrame function is the script that is not working, what can be the mistake?
sorry for the bad english!

View Replies !    View Related
PLEASE HELP Button Inside A Movie Clip..to Call Different Scene On The Movie
i have a button "within" a movie clip, i cant get it to work to call another "scene". i already used "_root." so the command will apply to the main time line but still, its not working.


on (release) {
_root.gotoAndPlay("scene2", 1);
}
thanks!

View Replies !    View Related
How To Get A Button Inside Of A Movie Clip Play The MAIN Movie
how to get a button inside of a movie clip play the MAIN movie

( reposted, bad grammer in 1st one)


I got a button, inside of a movie clip.....
How do I get the button to have the MAIN movie play on click, not the MOVIE clip

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved