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




Accessing Function Inside Movie Clip



I created a movie clip in Flash. It has a few text fields, another clip that loads an image, and another clip that acts as a button. In its property settings, I set it for export and gave it the class name of ModuleClip.

I can dynamically create a bunch of these clips and arrange them. Using a loop, I can access a custom variable in all of them...


ActionScript Code:
trace(MovieClip(getChildByName("mod"+i)).num);

but I can't access a custom function in the clip the same way...


ActionScript Code:
MovieClip(getChildByName("mod"+i))fadeInText();

I figure the problem is that fadeInText() is not a function of MovieClip, so I tried...


ActionScript Code:
ModuleClip(getChildByName("mod"+i))fadeInText();

but that still doesn't work.

The error I get is...

Cannot access a property or method of a null object reference.

What am I missing?

Thanks for any help you can provide.



ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 07-26-2008, 01:07 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Accessing A Movie Clip Inside Of A Button
I have a movie clip inside of a button that I want to navigate through when certain events happen to the button. The button(instance name : btn) is on the stage and the movie clip(instance name : my_mc) is inside of the button. The following code:

ActionScript Code:
btn.addEventListener(MouseEvent.MOUSE_OVER,onOver);
btn.addEventListener(MouseEvent.MOUSE_OUT,onOff);

function onOver(event:MouseEvent):void{
    btn.my_mc.gotoAndPlay(2);
}
function onOff(event:MouseEvent):void{
    btn.my_mc.gotoAndPlay(11);
}

gives me the Error #1119: Access of possibly undefined property my_mc through a reference with static type flash.display:SimpleButton.

Thanks for any help,
BP

Accessing Component Variable Inside A Movie Clip.
Hi there,

I'm having problem when trying to access a component variable inside a movie clip....

the component is from FLVPlayback (compiled clip) the varible is "contentPath"... I name this component movie_mc.. this component is placed inside a movie clip..

The component is inside a movieclip called "player" I have correctly set the player movie clip linkage identifier for action scripiting..

so .. what im trying to do is..


// attachiong movie clip player_mc_temp to the root..
_root.attachMovie( "player", "player_mc_temp", _root.getNextHighestDepth(), {_x:238, _y:4} );

// setting the value of contentPath inside the movieclip
_root.player_mc_temp.movie_mc.contentPath =_parent.urlarray[i];

the "_parent.urlarray[i]" have the right value, and its trace correctly,
its a valid HTML url linked to the .flv file.

the player seemed to be attached properly but the video file wont run..
I think i cannot set the value of contentPath like this...

"_root.player_mc_temp.movie_mc.contentPath =_parent.urlarray[i];"


can someone help me im still newbie in flash action scripting....

thank you very much in advance.

[Flash MX] Problem: Accessing A Component From Inside A Movie Clip
Okay I have this problem and I can't for the life of me figure out what's wrong. Here is an outline of what is happening:


1. I have a movie clip that contains two components, a combo box and a check box.

2. The combo box has the instance name "comboBox", and the check box has the instance name "checkBox".

3. The movie clip is exported for actionscript with the identifier "test".

4. I run the following code:


ActionScript Code:
attached = _root.attachMovie("test","componentContainer", 1);attached.comboBox.addItem("A", 1);


5. The item is not added to the combobox and I can't figure out why.

However, when I run the following code instead:


ActionScript Code:
attached = _root.attachMovie("test","componentContainer", 1);attached.comboBox._visible = false;


The combobox becomes invisible!

I can't understand why the addItem() function doesn't work but the _visible property does. Could it be a bug? Or some type of referencing issue? Please, I'd appreciate any help or ideas about why this is happening.

[Flash MX] Problem: Accessing A Component From Inside A Movie Clip
Okay I have this problem and I can't for the life of me figure out what's wrong. Here is an outline of what is happening:


1. I have a movie clip that contains two components, a combo box and a check box.

2. The combo box has the instance name "comboBox", and the check box has the instance name "checkBox".

3. The movie clip is exported for actionscript with the identifier "test".

4. I run the following code:


ActionScript Code:
attached = _root.attachMovie("test","componentContainer", 1);attached.comboBox.addItem("A", 1);


5. The item is not added to the combobox and I can't figure out why.

However, when I run the following code instead:


ActionScript Code:
attached = _root.attachMovie("test","componentContainer", 1);attached.comboBox._visible = false;


The combobox becomes invisible!

I can't understand why the addItem() function doesn't work but the _visible property does. Could it be a bug? Or some type of referencing issue? Please, I'd appreciate any help or ideas about why this is happening.

Accessing Function From Movie Clip Bug
I have this function

function fHighlightBall(myTarget)
{
Ball = new Color(_root[myTarget]);
Ball.setRGB(0xFF0000);
_root.strTester = myTarget;
}

which work perfect when I call it from the action of a movie clip on the main timeline.

onClipEvent (enterFrame)
{
_root.Functions.fHighlightBall("mcNumber_15");
}

but when i try to call it from a frame inside of a movie clip like this it doesnt set the color but it does set the strTester variable to the passed parameter.


_root.Functions.fHighlightBall("mcNumber_15");

Accessing A Movie Clip/s Inside A Movie Clip
This has most propably been answered numorous times but i cant get it to work.

Having trouble trying to access a movie clip/s inside a movie clip. What i have is an on RollOver event that tweens the mc then i have mc's inside that which i would like to click on to do something else. Can anyone help???

I have a little piece of code that works with a on mouse move but i dont really wont it to be on mouse move rather on rollover...


ActionScript Code:
menu.onMouseMove = function() {
    if(menu.hitTest(_xmouse, _ymouse, true)) {
        this.tween("_y", 40, 0.5, "easeoutquad");
        menu.gotoAndStop("open");
    } else {
        menu.gotoAndStop("closed");
        this.tween("_y", 0, 0.5, "easeoutquad");
    }
}

Assigning Function To Movie Clip, Inside Of Movie Clip Help
good morning all,
I have a quick question which has been bugging me this morning. Basically I am trying to assign a function to a emtpy movie clip, which loads a external
.swf, which it self is inside a large, emtpy movie clip.


Code:
//---------------------------------START FUNCTION---------------------------------
//loading of "product_window" - main banner of the different products
function product_window_load() {
_root.createEmptyMovieClip("product_section", this.getNextHighestDepth());
// this creates the movie clip in which contains the seperate "product_window"'s


//---------------------------------START LOOP---------------------------------
for (i=1;i<=_root.product_window_No;i++){
//function to call up loading
_root.product_window_name = "colour"+i+".swf"
//this defines the name of ".swf" of the "product_window" being loaded
_root.product_window = "_root.product_window"+_root.product_window_id;
//defines name of "product_window"
_root.product_section.createEmptyMovieClip(_root.product_window, i);
//creates blank movie clip which will subsequently load the individual product .swf's
_root.product_section[_root.product_window].loadMovie(_root.product_window_name);
//loads the ".swf" file, the name is determined by the variable "_root.product_window_name"

//----------------------START FUNCTION----------------------
_root.product_section[_root.product_window].onRollOver = function () {
trace ("onRollOver called " + _root.product_window);
};
//----------------------END FUNCTION----------------------
_root.product_window_id ++ ;
//increases the value of "product_window" by 1

Code:
_root.product_section[_root.product_window].onRollOver = function () {
trace ("onRollOver called " + _root.product_window);
};
does not work
but if i just target the the main empty movie clip which contains all the other ones, it works fine.

Code:
_root.product_section.onRollOver = function () {
trace ("onRollOver called " + _root.product_window);
};
I know i can proably get this to work using duplicate movie clip and cretaing a physicl movie clip on stage, but i was curious whether i can assing a function to a movie clip inside a movie clip

any help on this would be great
thanks
-smokey

ps. i know its not the smoothest coding, but its been like 3-4 years since ive been using flash

Button Inside Movie Clip Called By Function
Hi all,
I've got a button (with a mouseover state) placed inside a movie clip symbol. An instance of this movie clip is placed on the stage. The button only appears on frame 2 of the movie clip. A function is called upon certain conditions to show frame 2 which will reveal the button. The 'on release' code for the button is also contained in the function.

The problem is that the rollover effect doesn't work once the function is called. The function works perfectly otherwise - and the movie clip containing the button works fine as well as long as it is not called from a function.

Any help would be greatly appreciated.

[F8] How To Add Function To An Animated Button Inside A Movie Clip?
Please Help Me!!!

I Don't Know How To Add (on Release Go To Scene 1 Frame #1) To An Animated Button That I Put Inside A Movie Clip, Only This Movie Clip Is In My Scene, And The Button Appear Moving, All Its Functions Are Working Ok: Up, Over And Down, I Added Its Action In The Button Instance But It Doesn't Work In The Movie Clip.

What Can I Do???

Accessing Vars Inside Function
I want to be able to get a varible set outside a function useable inside the function. I know this has to do with global/local var positions.

I know PHP well so...
In PHP its

PHP Code:




function test() { global VAR .... };







Whats the actionscript equalivilent to global

Cheers

Accessing Variables From Inside Function
Hi there, for you experts this will be simple but I'm just starting on ActionScript so I'm rather useless


Code:
myData.load("detailclip_feedflash.php?ID=5002");
var myLinkers:Object = { before1:"33434", before2:"", before3:"", after1:"", after2:"", after3:"", pdf:"", clip:""};
myData.onLoad = function(succes){
if(succes){
// DO WORK
myLinkers.before1 = this.beforeimage1;
} else trace ("Error loading data")
}
I have a data object being set in the first frame of my video then I'm calling variables from a PHP file and planning to do some work then set the variables into a variable that can be accessed in ANY part of the current execution.

The issue is that it doesn't seem be modifying the variable outside the function. I thought I should use _global.myLinkers.before1 = "" but that didn't work either.

I know I'm missing something to access the variable but WHAT?

Arg.

Accessing Array Inside Function
Hi Friends,

Just help me to access all those array from outside of function, as you can see trace(_global.srd) and trace(dataArray) are not returning anything from outside of function. Any luck ?


Code:
var dataArray:Array = new Array();
_global.srd = new Array();

xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("someNotes.xml");


function loadXML(loaded) {
if (loaded) {

var loopLength = this.firstChild.childNodes.length;
home_Node = this.firstChild.firstChild;
for(i=0; i < loopLength; i++){
heading = home_Node.firstChild.nextSibling.firstChild;
contents = home_Node.firstChild.nextSibling.nextSibling.firstChild;
dataArray[i] = new Array(heading,contents);
home_Node = home_Node.nextSibling;
}
_global.srd = dataArray;
}
}

trace(_global.srd);
trace(dataArray);

Thanks in advance!

Function And Target Problem (calling From Inside A Movie Clip's Timeline)
(Using Flash MX 2004 Pro, AS2)
I have a whole bunch of custom setInterval functions defined in an included AS file that have either a 'gotoAndPlay' or 'function()' action within. All of my setInterval functions that are being called globally from the main timeline of the movie work beautifully, however I have two calls that are calling their function from within a movie clip of the same timeline...they are not working, they're not even calling back to the function. Here's my function code in the AS file:


Code:
function cardRevealPause(){
gameLogic.gotoAndPlay("shuffle");
clearInterval(welcomeTimeOutIntervalID);
clearInterval(gameTimeOutIntervalID);
clearInterval(cardRevealPauseIntervalID);
}
Here's my global call code from within the movie clip 'gameLogic' timeline:

Code:
_global.cardRevealPauseIntervalID = (cardRevealPause, _global.cardRevealPauseInterval);
ANy thoughts as to why this won't work for me??? Thanks in advance!

Function And Target Problem (calling From Inside A Movie Clip's Timeline)
(Using Flash MX 2004 Pro, AS2)
I have a whole bunch of custom setInterval functions defined in an included AS file that have either a 'gotoAndPlay' or 'function()' action within. All of my setInterval functions that are being called globally from the main timeline of the movie work beautifully, however I have two calls that are calling their function from within a movie clip of the same timeline...they are not working, they're not even calling back to the function. Here's my function code in the AS file:




Code:
function cardRevealPause(){
gameLogic.gotoAndPlay("shuffle");
clearInterval(welcomeTimeOutIntervalID);
clearInterval(gameTimeOutIntervalID);
clearInterval(cardRevealPauseIntervalID);
}
Here's my global call code from within the movie clip 'gameLogic' timeline:


Code:
_global.cardRevealPauseIntervalID = (cardRevealPause, _global.cardRevealPauseInterval);

ANy thoughts as to why this won't work for me??? Thanks in advance!

Problems Accessing A Global Variable Inside A Function
I can't get the search feature to work at the moment, so I'll post it.

I have several functions inside a movie clip that I need to access the same variable. For some reason, one particular function cannot access this variable. Any ideas as to what could cause something like this?

Thanks in advance.

Accessing Functions Inside Dynamically Attached Clip
i've got clips being attached using attachMovie (clips are in the library with linkage id's).

inside those clips are two functions. I'm trying to access those functions after I attach the clips, but not getting anywhere.

I assume that the methods of my attached clip (the functions) aren't available immediately, but rather after the clip actually 'loads' to the stage they are.

I thought that clip.onLoad would get me somewhere but that's not firing! any ideas?

Using A Movie Clip Inside A Movie Clip To Start A Frame Of An MC Inside A Movie Clip
Situation:
I have a movie clip inside a movie clip with a button inside of it.

This button on release goes to a different movie clip(svideo) in a different frame on the maintime. This movie clip has a movie clip(portfolio) inside of it.
Okay: I use an absolute path on the aforementioned button
on release
_root.svideo.portfolio.gotoAndPlay(60);

But, for some reason Flash won't go to frame 60 of the portfolio movie clip that is inside of the svideo.

I have tried numerous variations on reaching frame 60 of portfolio. Like going to the maintime line and going to the portfolio MC. Also, portfolio and svideo are the instance names and not the name of the actual movie clip.

If anybody could help, I would appreciate it. Thanks.

Accessing Text Field Inside Movie
I want to address a text field ("/ann_input") which is located inside a mc ("/ann_mov"). How do I do that? This is what I've tried out already:



Code:
onClipEvent (enterFrame) {
if (ann_mov._currentFrame == 2 AND ann_mov.ann_input != "") {
this.gotoAndStop(2);
}
}
also:

Code:
onClipEvent (enterFrame) {
if ("/ann_mov"._currentFrame == 2 AND "/ann_mov"."/ann_input" != "") {
this.gotoAndStop(2);
}
}
- naturally, neither works. HELP!

Help Please.. Having Trouble With Accessing A Dynamic Text Box, Inside A Movie
am trying to access a dynamic text field that is in a movie which is contained in an array.

My code looks something like this

movies = new Array();

// add1, add2, etc are the instance names of the movies

movies[0] = add1;
movies[1] = add2;
movies[2] = add3;
movies[3] = add4;
movies[4] = add5;

/*inside of the movie addtest (add1 - add5 are all instances of this same movie) I have a dynamic textfield called number1. How do I access this field in order to change it?

I have created an array that I would like to put the text from the fields in.*/

num1 = new Array();
for (i=0; i < 5; i++)
{
num1[i] = _root.movies[i].number1;
}

is this right? If not how would I go about doing this??

Any help would be appreciated.

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.

Accessing Movie On Root While Inside A Movie
I am new to flash

I am working on flash 8.
I want to know that
i have two movies on the ground panel . i have placed one button in one movie . when i click that button i want to set other movie's alpha =0 that is placed on the root.

Problem Accessing Movie Clips Inside Of Loaded Swfs
Hey All;

Here's what I am having problems with. In swf movie A I have a movie clip on the stage with the instance name SQUARE. In swf movie B I load in swf movie A by using the following:

this.createEmptyMovieClip("world_mc", 999);
loadMovie("A.swf", world_mc);

Now... the following line of code gives me undefined:

trace (world_mc.SQUARE);

Why? Can I not access the movie clip SQUARE once swf A is loaded into swf B?

Thanks.

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(){

Accessing Movie Clips Function
Pretty simple question but I can't get a straight answer in any search.
I have a movie clip called whtebrd and inside of it is a function called addLines. How can I run the function from root? Does it matter if the function sits on the 5th frame of whtebrd's timeline?
I tried this.whtebrd.addLines() but nothing happens.
Thanks in advance.

Can't Seem To Get The Paths Correct When It's Occuring Inside A Movie Clip Inside
main movie on _level0, navigation loads into _level1, icon is dragged and dropped loading another samples.swf into _level2.

drag and drop works fine running outside of main movie but not inside main movie. i'm assuming i've messed up paths.

i tried to include the code (twice now) but it keeps cutting off my message.

it's an action on a button inside a movie clip inside a movie loaded into _level1. it needs to reference a movie clip on the main timeline of the _level1 movie. what would the path be?

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 ?

Movie Clip Buttons Nested Inside Movie Clip Dont Work
Hi people!
im having a problem here.

in my first frame i have a movie clip named "menu_mc".
i have this AS for this movie:

Code:
this.menu_mc.onRollOver = function() {
menu_mc.gotoAndPlay(8);
}
this.menu_mc.onRollOut = function() {
menu_mc.gotoAndStop(7);
}

thats working ok, the menu_mc plays on rollover from frame 8 till frame 12 where stops.
On frame 12 (this is inside the menu_mc movie clip) i have another movie clip, named button1_mc.
and also i have AS controling that MC:

Code:
this.button1_mc.onRelease = function() {
getURL("index.htm", "_self");
}


The problem is that when i rollOver on menu_mc it work fine and the button1 appears, the problem is when i try to click button1...
doesnt work.

the swf you can see it on www.wt.com.mx/menu.swf
can anybody help me please?
what im doing wrong?
or what other ideas can you give me so i can make that work.

thanks!

Accessing Function Located In The Loading Movie
I really need help on this one. I have a function to resize my stage which is located in the main movie. There is another movie which is loaded into the main movie and I want the loading movie to call the resize function which is located into the main movie. In short how can I access functions which are located on the main loading movie.

I have treid _level0.resize(); // Doesn't work
_level.parent.resize(); // Doesn't work

But at the same time there is a text field which I can easily update throught the loaded movie by

_level.my_text.text = "Anything"; // Does work

I have spent my whole night on this but can't find anything on it.

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

Load A Movie Inside Blank Clip From Inside Itself?
Hi,
I am working on a site and I have a blank movie clip called contents. I have a button that when clicked, loads a swf (2.swf)inside of it. then I have a button in 2.swf, when clicked, I want it to load a swf in contents (the same movie clip that it was loaded into). I have tried using _root. and _parent. infront of the loadmovie code, but those aren't working. What code would I use to do this?
Thanks, Matt

How To Manipulate A Movie Clip On The Main Stage From Inside Another Movie Clip
I have a button inside a movie clip, and I want it to work that when you hit the button, a different movie clip will go to frame 5. anyone know how to help? I think it has something to do with which level it is on, but I can't manage to figure out anything else.

A Button Inside A Movie Clip, Within A Movie Clip, Calling Another Scene:
Is it even possible?

I have been trying to do it for the last few days for a site I am working on.

I have done searches in many forums and it's foolish looking for an answer that way, because quite frankly every thread I opened was something to do with LoadMovie or GetURL, etc.

What I have right now is on the button in my Menu Bar Movie Clip:

on (release) {
gotoAndPlay(285);
}

Which plays a fancy little animation in the movie clip and then on the last frame of that movie clip I had:

gotoAndPlay("Contact", 1);

Which is the Scene for the "Contact Us" Scene named "Contact"

One would think that it would load up the scene and play at frame 1, however all that happens is it reloads the movie clip of the "Menu Bar" at frame 1 and starts over, not even realizing what I asked.

Anyways, I figured there's a script or something that tells it to look outside of the movie clip or to the _Root, or whatever.

If someone has a solution, it would be greatly appreciated.

Sorry I have no example to show, since I have yet to upload it. (It's my company's web site, and I don't think customers would want to see some half-arsed web site that's not complete.

Thanks in advance.

Create An Empty Movie Clip Inside An Existing Movie Clip?
I'm making sort of a tabbed navigation scheme by reading the data for each tab in from an XML file. What I'm wondering is if it's possible to use createEmptyMovieClip() to make a new empty movie clip inside a movie clip that already exists on the stage.

Using
ActionScript Code:
m_anchor.loadMovie(bg_image);
works as I would expect. bg_image is just the relative path to an image file, and m_anchor is a movieclip already on the stage. However, doing a similar thing:
ActionScript Code:
m_anchor.createEmptyMovieClip("textbox", this.getNextHighestDepth());
and then drawing a shape (a rounded rectangle, which I then want to put text on top of) doesn't work. It works if I just say "this.createEmptyMovieClip" instead of attempting to create it inside the m_anchor clip, but if I do that, the "textbox" is created at the root level and I can't unload it along with everything else in the "m_anchor" clip. Is it possible to create a new empty movie clip inside of one that is already on the stage?

Thanks!

Problem Getting Movie Clip Inside Of Movie Clip To Face Mouse
I used the code below to make a movie clip face the mouse, it works when I use it on a movie clip that's not embedded in another movie clip, but when I used it on an embedded movie clip, it's axis seems to change.









Attach Code

var stickGun:MovieClip = this.stick_holder.stickGun_mc;
//stick_holder.stick_mc.stickGun_mc

stage.addEventListener(Event.ENTER_FRAME, onMove);
//stick_holder.stick_mc.stickGun_mc.addEventListener(MouseEvent.MOUSE_MOVE, onMove);

function onMove(event:Event):void {
// get the radian value of the angle between the clip and the mouse...
var myRadians:Number = Math.atan2(mouseY - stickGun.y, mouseX - stickGun.x);
// convert it to degrees...
var myDegrees:Number = Math.round((myRadians * 180 / Math.PI));
// get the horizontal and vertical distance between the clip and the mouse...
// rotate the clip toward the mouse...
stickGun.rotation = myDegrees;
}

Placing Actionscript Movie Clip Inside A Movie Clip Symbol
I'm loading an external image into an empty actionscript movie clip (holder1) using MovieClipLoader(); on frame one of my movie and is invisible. Then when the movie plays, there is an empty movie clip symbol (image1_mc) that is placed manually on the stage within another movie clip symbol (flash_mc), and is also on a bottom layer of a mask layer which is animated. Is it possible to place "holder1" inside of "image1_mc" so that I can treat it as if it were an embedded image? In other words, have the image in "holder1" inside of the manually placed movie clip symbol "image1_mc" so that I can use it like a regular symbol on the stage?

Control Movie Clip In Container From Button Inside Other Movie Clip
There are three movie clips involved in this question.

1. A main movie clip that has a target empty movie clip where an external swf loads.

2. A menu movie clip that is built from button symbols and has its own timeline.

3. The external movie.

When a user clicks on the menu, the external swf loads into the empty movie clip target.  This part works fine. Here's the code:
on (release) {    
    loadMovie ("Lesson1.swf", "_root.container");
}

I want to use one external swf for all lesson, versus 20 external swfs. The problem I'm having is controling at what frame the external swf loads.  I've tried adding --gotoAndStop (15) -- for example. I've also tried adding, gotoAndStop "_root.container" (15), but that doesn't work either. The gotoAndStop action ends up controlling the menu movie clip timeline instead of the movie loaded into the container. I figure this is because the menu mc has "embedded" buttons and it's own timeline.

Any  help you can offer will be much appreciated.

Thanks
Sheila



Creating A Button To Open A Movie Clip From Inside A Movie Clip?
I'm using a hexagon menu to display some images. One image is placed on each slide of the hexagon menu (which can then be rotated left and right to see other "slides").

What I want to do now is to be able to click on the object (image) as a button and for it to go to another scene which shows the image blown up and some description next to it (which is another movie)

I have tried the following which doesn't seem to work:
Created an invisible button (or choosing the image as a button) and having

on(release) {
gotoAndPlay("scene 5", 1);
}

this doesn't work when I use it over the hexagonal menu, but when I move the button to somewhere else on the screen (not over the movie) it works.


Please can someone help with this - Ive been working on it flat out over the weekend and desperately want to make it work. any ideas would be appreciated!! thank you

Loading External Movie Clip With A Button Inside Another Movie Clip Help
Hi,

I am working on a scrolling thumbnail movie clip, that when you click on the thumbnail button inside the movie clip it will load an external movie clip. I have an empty movie clip on the main stage, and have been trying all sorts of code, but for some reason it doesn't like that I am inside a movie clip using buttons. It can't seem to find the external swf.

I have tried:

on (release) {
loadMovie (ithink.swf, "loader");

and

on (release) }
if (firstTime == true) {
loadMovie("ithink.swf", _root.loader);
firstTime = false;
} else {
_root.clicked = "ithink.swf";
_root.loader.gotoAndPlay("goback");
}
}

and so far nothing, for some reaosn when I click on a button outside of the movie clip with the above code it loads... and than the other works too, but if I click on the buttons inside the scolling movie clip first they won't work.

Any suggests or ideas!!?

I would really appreciate it... I am beyond frusterated!!

Using External .txt Inside Movie Clip Inside .fla
I've seen a hundred and a half posts on similar subjects, but goshdarnit, I just can't make this work. Let me explain the problem, and I've included a link to a Zip file with my .fla file and the away.txt file I'm calling the variables from.

Basically, I want to create an interactive menu thing, that starts with a row of each of the 26 letters of the alphabet. When one clicks on a letter, the letter is tweened to a larger faded state, and so is the rest of the alphabet, and I want the names of the schools starting with that letter to then fade in. I have a movie clip inside the last frame of the main tween, which should then tween (fade in over 12 frames) the graphic symbol containing my dynamic text box, which is supposed to be linked to the text variables in the external file. The text variable is created on the first frame of the main timeline using Actionscript on the static header layer, and so I should be able to load it inside my movie clip (I think). Everything looks fine to me, but then I've only been using Flash for 2 weeks.

My Zipped source files can be found at: http://www.tolcs.org/athletics/away.zip

If anyone would be willing to download my source files and give some wonderful advice, I'd revere and adore them forever.

Accessing The Scene From A Movie Clip
ok on Scene1 there are 3 frames >

frame1 = movie clip A and a Stop action
frame2 = blank key frame
frame3 = movie clip B and a stop action

when movie clip A playes out i want movie clip B to start.

so i added an action key frame to the end of movie clip A that said, "gotoAndPlay ("Scene1", 3)"
and it didn't work so i tried, "_root.gotoAndPlay ("Scene1, 3)"
and it still didn't work.
so what do i do to get it to work please.

Accessing Movie Clip In ScrollPane
I feel like an idiot but I can't get this. I need to duplicate a movie clip x number of times inside the scrollPane so if it goes off the page it'll have the scroll bars.

I know how to link my movie clip so it appears in the scroll pane, but I can't figure out how to talk to it with the action script so's to be able to suplicate it???

It seems that it should be simple but I am losing my mind.

Help

Thankis

Accessing A Child Movie Clip
This code doesn't work. The movie clip instance "start" is nested in a movie clip called "bridal_navigation".

_root.start.onRollOver=function(){
black=new Color;
black.setRGB(0x000000);
}
_root.start.onRollOut=function(){
teal=new Color;
teal.setRGB(Ox33CCCC);
}

[F8] Accessing A Movie Clip Thats Been Attached
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





onEnterFrame = function(){
digi_mc.moveY(102, 3);
installation_mc.moveY(129, 3);
photography_mc.moveY(156.3, 3);
photography_mc.attachMovie("navi", "nav_mc", 1);
}

photography_mc.nav_mc.previous_btn.onRelease = function() {
prevImage();
}
photography_mc.nav_mc.next_btn.onRelease = function() {
nextImage();
}

function picture_num() {
current_pos = p+1;
photography_mc.nav_mc.pos_txt.text = current_pos+" / "+total;
}

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();
}

Accessing Sub-components Of A Movie Clip
I have created a MovieClip with multiple layers and nested MCs inside. I use actionscript to create multiple instances of that MC on the stage. How can I get access and manipulate the sub-MCs for each instance with AS?

For example, let's say I have an MC with multiple square shapes, each square being a separate nested MC. I attach that MC on stage but I want to be able to programmatically manipulate each of the squares in it. Now imagine creating multiple instances of that MC, does that require a different approach?

Any ideas? I am stuck.

Thanks in advance.

Accessing Text Within A Movie Clip
(n00b here, so be gentle) I searched the forums for about half an hour, but was unable to find an answer to this problem (which I think is very simple).

I've got a movie clip in the library that contains a dynamic textbox with an instance name of "myText". I'm trying to add multiple versions of this movie clip to the stage with different text values. I think I should be able to do this:


Code:
currItem = new Item();
currItem.myText.text = "something";
But when I do this, I throw an error: "1119: Access of possibly undefined property myText through a reference with static type flash.displayisplayObject.

Accessing A Movie Clip In The Library
Say, I have a movieclip/Sprite in my library by name sample.
So, the statement


Code:
var x:sample=new sample();
will instantiate the movieclip which I can display using addChild.

Now, can I load the movieclip using a String containing the name of the movieclip, i.e "sample"? Is there a method for achieving this?

Movie Clip Accessing Question
ok...on my stage of my main timeline I have a replay button called replay_btn. It physically exists on the stage. I also have a movie clip that is 100 frames long called ani_mc and at the end of ani_mc I have a stop command (on frame 100). Now, I want to make my replay button .visible false while ani_mc is playing, and make replay_btn.visible = true when ani_mc reaches the end. From inside of ani_mc on frame 100 how can I access replay_btn on the main stage? I have tried everything I can think of. parent calls, stage calls, passing a boolean value, this.parent....I'm stuck. Any help would be great.

Accessing A Movie Clip Under A Mask
hi all,

does anyone know if you can interact with a movie clip
that is behind a mask? might seem like a dumb question but i'm stumped.

basically i've got this box which i scale to the right. as it stretches out, the mask within this box reveils movie clip buttons. but although i can see them,
i can't interact with them.

anyone know a work around besides using something like myClip._visible = "false". it looks cool with the mask reveiling the movieclip at the last minute and so i'd like to keep this look if possible.

thanks!!

Accessing Frames In Movie Clip
This is a really dumb, basic question, but my inexperience combined with lack of sleep is making this difficult.

I have a movie clip called "desc_sushi_saumon" who's animation starts at frame 2. On the same layer as this clip is a clip called arr2_main. I want to play "desc_sushi_saumon" frame 2 when I click on arr2_main.

I tried this:

on (release) {
desc_sushi_saumon.gotoAndPlay(2);
}

and that doesn't work. I've tried using the full pathname:

_root.pages.page1_m.desc_sushi_saumon.gotoAndPlay(2);

but that doesn't work. I've also tried:

_parent.desc_sushi_saumon.gotoAndPlay(2);

but that doesn't work, either.

What am I overlooking?

joe






























Edited: 07/17/2007 at 07:23:17 PM by spamGactus

Copyright © 2005-08 www.BigResource.com, All rights reserved