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




[F8] AS2.0 Problem With Movieclip Used As Button Within Another Movieclip.



Hi Guys

Ive been battling with a problem in my flash script.

I have a button on the _root that is setup for the onrelease event. when the on release event happens another movie clip also on _root that contains 3 movieclips inside plays a tween motion moving the movieclips into place(its a fly out menu).

the problem im having is that none of the on events are working, Im not even getting a hand over the movieclips, I have given everything the correct instance names but no luck. I do get the onRelease to work if i remove the tweens and have only the movieclip on the first frame.

I have attached my file for further investigations.

All help would be appretiated.
Regards
Pixel



FlashKit > Flash Help > Flash ActionScript
Posted on: 08-30-2007, 03:19 PM


View Complete Forum Thread with Replies

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

Control A Nested MovieClip From A Button Component Inside A Seperate MovieClip.
I am a beginner in using Flash and Action Scripting.

This is the Scenerio:

I want to control a movieclip that is inside of another movie clip.
I control it from a button component that is inside of a seperate movie clip.

test = button component instance name
test1 = function
test2 = Movieclip instance name
test3 = Movieclip instance name
testbutton = movieclip name where button component is located

I am able to control a movieclip on the main timeline with the following AS 3.0:

test.addEventListener (MouseEvent.CLICK, test1);
function test1(event:MouseEvent):void
{
event.target.root.test2.gotoAndPlay(2);
}

I want to control a movieclip inside MovieClip1.

I tried this:

test.addEventListener (MouseEvent.CLICK, test1);
function test1(event:MouseEvent):void
{
event.target.root.test2.test3.gotoAndPlay(2);
}

The movie loaded fine when I tested but got this error when I pressed the button:

TypeError: Error #1010: A term is undefined and has no properties.
at Untitled_fla::testbutton_26/test1().

Please help!!!!!!!!!

Loading A Movieclip On The Main Stage From A Button Within A Movieclip - Big Headache
Hi there,

i am trying to put together a portfolio site, which uses a 'floating' panel with buttons on it. In order for it to move around it has to be a movieclip. So all the buttons are stored within a single movieclip, which is giving me a headache because i want those buttons to load other movieclips from my library onto the main stage (as like a popup window within the flash)

Its all slightly confusing. i have tried using this code based within the movieclip where my button is based:

button_play.buttonMode = true;
button_play.addEventListener(MouseEvent.CLICK, OpenBox);
function OpenBox (e:MouseEvent):void{
this.addChild(new mc_box());
}


button play is within a movieclip called mcTweenMe2 (which is on the main timeline) and i want the movieclip to be loaded on the main timeline (not within in the movieclip where the button 'button_play' is based) mc_box is the movieclip i wish to load on the main timeline (in the centre) with the ability to close it also!

Bit of a headache, please help me someone i have run out of sites to look for answers!

PS: does anyone know why stop (); wont stop my timeline playing like it used to in AS2? beacause another option for making my site work is making this button target labeled frames in the main timeline, however stop (); don't seem to work now!

Thanks!

[F8] Control Movieclip From Button Inside Another Movieclip
ok. I have the Main Timeline..on the stage i have "side_menu_mc" inside that i have "menu_menu_mc"."slider" is menu_menu_mc's Instance name.

Inside "menu_menu_mc" i have a button (services_btn)."button_1" is its instance name. Upon clickin on this button, i want a frame labelled "services" (frame 18) in "side_menu_mc"'s timeline to display.

i attempted this.after some googling.but it does sweet nothing.


Quote:





Originally Posted by my shizer code


menu_menu_mc.services_btn.onRelease = function() {
trace("button pressed");
_root.gotoAndStop("services");
}

Whats The Script For A Button In A Movieclip Within A Movieclip?
Hi

Whats the script for a button in a movieclip within a movieclip?

I have the following but the link will not work?

on (release) {
tellTarget(_root) {
getURL("http://www.google.com", "_self");
}
}

Whats The Script For A Button In A Movieclip Within A Movieclip?
Hi

Whats the script for a button in a movieclip within a movieclip?

I have the following but the link will not work?

on (release) {
tellTarget(_root) {
getURL("http://www.google.com", "_self");
}
}

How To Make A Movieclip Button Open Another Movieclip?
What is the code to make a movie clip button....when pressed...open or plays another movieclip...example...

i have a button..and its a movie clip with roll over and rollout effect..once pressed...how do i make it link to an outside movieclip...(outside the buttons layer)

Button Inherits Movieclip And Movieclip Button Properties
Hi,

I am working on a component to blur pictures and use it as buttons. I got it all working but found something I do not completely understand. May be somebody knows the answer. Since movieclips can also be used as buttons I started to define a new class (I show only fractions of the script):


PHP Code:



MovieClip.prototype.createBase=function(eqClip,eqClip_1,eqClip_2,tPress,tRover,tLoad){

and so on...

}
    if(tPress){
        tRover=false;
        tLoad=false;
        this.onPress=function(){
            //count will advance here.
            count++;
            //first we fade out the pic
            fadeOut();
        }
    }
    if(tRover){
        tPress=false;
        tLoad=false;
        this.onRollOver=function(){
            count++;
            fadeOut();
        }
    }
    if(tLoad){
        tRover=false;
        tLoad=false;
        this.onLoad=function(){
            count++;
            fadeOut();
        }
and so on..

Button.createBase(eqClip,eqClip_1,eqClip_2,tPress,tRover,tLoad);




Actually "button" is the name of a movieclip, which inherits the new properties. I can now put instances on stage and write something like:
button1.onRollOver=function(){
this.Button.onRollOver();
}
button1.onRelease=function(){
textField.text="This is button 1 in action.";
}
This will do all what is supposed to do.

But when I change the name of the Movieclip to "myBut", it only performs the blurring but I cannot use it as a button any more and onRelease does not work. In other words if we name a movieclip "Button" or "button" it will automatically inherit button properties. Is that the case? Anybody heard of that?

Playing A Movieclip From A Button In Another Movieclip?
i have a mc with a button in it. when i click the button, i want another mc to play 'over the top of it'

i think this is to do with levels (is the second mc at level1 or 2? and how to i target it from my button (with actionscript?)

thanks in advance

Align A Movieclip To A Button/another Movieclip?
Hey guys
I have a movieclip that contains a MC which my user has created a dynamic polygon and a button. I can scale the button to the same size as the polygon MC but cannot figure out a way of aligning the button - anyone got and suggestions?!?
Thanks in advance
Ol

Control Movieclip From Button In Another Movieclip
I've been searching and searching for the answer to this newbie problem, but I can't find it, so I hope someone won't mind pointing me in the right direction.

I have 5 buttons within movieclip (1); movieclip (1) is located on the main timeline. I'm trying to get the buttons to jump to a certain frame of movieclip (2) which is also located on the main timeline.
The code I've been using for, say, the first button is:

Code:

Code:
on (release) { _root.mainwindow_rooms.gotoAndPlay("lounge"); }
"mainwindow_rooms" is both the library name and the linkage identifier of movieclip (2). It doesn't have an instance name on the stage (is that relevant?)

I can't get this to work. Can someone please help me with this? I have no idea what I'm doing wrong, I'm not very good with Flash.

Playing A Movieclip With A Movieclip Button
I am using AS 2.0 I have an animated movieclip (holder_mc) that contains 4 buttons (one is profile_btn). I also have a seperate movieclip named profileTitle_mc. I guess my question is how do I go to different frames of the main timeline from a button inside a movieclip? Right now, holder_mc is on frame 2 of the main timeline and profileTitle_mc is on frame 3 of the main timeline. I've switched the code around a lot, but I can't get the button to switch to the 3rd frame.

this.buttonHolder_mc.profile_btn.onRelease = function() {
this.gotoAndPlay(3);
};

If there's a better/easier/foolproof way of doing this please inform me

Thanks!

Movieclip Within A Movieclip Button Issue
The 2nd box is the one with the movieclip in it. When you rollover the box (keep in mind that your cursor has to remain on the box in order for the entire movie to play), it animates. When the box animation is complete the second movieclip plays. it plays the first logo, but the next and previous buttons don't work. How do i get the next and previous buttons to work? The fla is below

www.geocities.com/demetriusmcclain/services.fla

How To Use A Button In A MovieClip To Load A Swf Into A MovieClip
Hi,

I'm trying to use a button contained in a movie clip on the stage to load a SWF into another movie clip on the main stage. I have gotten it to work when attaching the action script directly to the button, however I would like to have all my action script contained in one frame. Any ideas on how to accomplish this?
I'm using ActionScript 2.0

Thanks,
Adam

Help With Movieclip/button Containing Sub Movieclip/buttons
Hi Im trying to create a certain type of button.
An example of this type of button can be seen on the navigation on the following website:
www.minipixel.com

The rollover button contains a movieclip and inside this movieclip ther are several other rollover buttons which lead to other sub-movie clips.
Does anybody have a similar working example so as I could look at the actionscript I cant seem to find anything online?
All help would be much appreciated...

Directing Movieclip With Button Outside The Movieclip..
Hello I've got a very simple question where I cant really find an answer to. I've checked my old files to see if I did it before, but I couldn't find anything. Here it goes:

On the mainstage I have a button and a movieclip. If I press this button I want the movieclip to gotoAndPlay a frame which I labeled "one". The thing is however that I forgot the code for the button to do this.


Code:

on(Press){
gotoAndPlay("one");
}
I know something has to go in front of gotoAndPlay but I forgot what. The movieclip's name is symbol 1, and its labeled movie. I also posted the simple flash file.

http://www.xs4all.nl/~karhen/Flash/

This problem should not be very difficult to solve, and it would really help me in developing future websites. Who has the answer??

Button In Movieclip In Movieclip Can This Be Done?
i have created a movie clip containing a sroller using actionscript, in this movie clip in this there is a another movie clip containing the pictures and buttons on separate lavers (the bits that scroll)

i have set up one instance of the button which has a onrelease gotoandplay action to scene1, (frame label) project 1

this should move the main timeline to the label and trigger another movie clip, but dosent can anyone shed any light on this

regards jason

i would be more than happy to email the flash document if someone is prepared to take a look

Button In Movieclip Of Movieclip
Ok, I could really use some help here. I've looked through the Board but didn't find anything that could explain it to me.

I have a button(button1) in a movieclip(Thumbs), which is in a movieclip that gets preloaded into level2 of my main movie.

I want to execute the photochange function (which is in the main movie timeline), from that button, which is where I think it has to be done. I also tried putting the photochange code on the button itself, but I don't think thats right.

This is the code on the timeline of the main movie. But its not working. Anything obvious that I am doing wrong.?

_root.level2.Thumbs.button1.onPress = function(){
trace ("test");
photochange(counter="0001");
};

Thanks in advance for your help.

Movieclip Button Within Movieclip
Hi,

I'm having some problems. I can't get a movie clip to act as a button once it is within a movieclip..... is there a way to do this.

E.g..

1mc (is the first movie clip)
2mc (is the second movieclip)

I enter the 1mc and it starts to play 2mc (from within 1mc), i can not now get 2mc to become a btn, i have tried using the target path finder in the actionscript page, both in relative and absolute, but no joy. Is there a way to call this mc up as a btn?

Cheers.

Movieclip Button In Movieclip?
i have put the attached code in a frame, that's in a movieclip. gotei13_thumbnail is a movieclip, that's in the same movieclip as the script.
why does this not work?
if i copy the script to a frame on the main timeline, and copy gotei13_thumbnail to the main timeline, it works just fine.
i'm guessing there's some more script i have to add?

please help me, asap. thank you.







Attach Code

gotei13_thumbnail.onRollOver = function(){
gotei13_thumbnail.gotoAndPlay("over");
}
gotei13_thumbnail.onRollOut = function(){
gotei13_thumbnail.gotoAndPlay("out");
}

























Edited: 05/23/2007 at 01:20:19 AM by setiawankla

On HitTest To A Movieclip(a) By Movieclip(b)i Want To Attach Another Movieclip(c) To
on hitTest to a movieclip(a) by movieclip(b)i want to attach another movieclip(c) to movieclip(b)which is in the stage,so how to do it??
can anybody help on this???

On (press) {... Button Starts Movieclip Starts Movieclip...
i'm no flashcrack, but you all are, thats why i ask you!

i have the following prob: a movieclip starts after loading. if a button is clicked to proceed to the next theme the visible movieclip has to (e.g.) fade out (framebased). after the fade out, a second clip has to start (background change, not framebased). during the last frames of that clip a third one starts with the content for the actual theme (framebased). the original clips are built in diff. layers, so that "tellTarget" is used.

right know it works in a basic way, which means: every clip start after the button-click. is is not synchronized.

any idea?
thanx 2 all gurus.

giz

? Resize Stage To Dynamically Match External Movieclip Loaded Into Empty Movieclip
Hi all,
Does anyone know how I can resize the stage to match the size of an external graphic/movieclip which is loaded into an empty movieclip,
thanks

? Resize Stage To Dynamically Match External Movieclip Loaded Into Empty Movieclip
Hi all,
Does anyone know how I can resize the stage to match the size of an external graphic/movieclip which is loaded into an empty movieclip,
thanks

? Resize Stage To Dynamically Match External Movieclip Loaded Into Empty Movieclip
Hi all,
Does anyone know how I can resize the stage to match the size of an external graphic/movieclip which is loaded into an empty movieclip,
thanks

#1009 Error Movieclip Inside Movieclip Changing The Alpha Property
Problem:
I'm getting this "TypeError: Error #1009: Cannot access a property or method of a null object reference."
What's happening in the flash file is that I've got a movieclip inside a movieclip and when you roll over one of the movieclips the alpha setting for the movieclip inside the initial movieclip is set to 1, then it transitions out back to 0 over a period of time.

var myTween:Tween = new Tween(event.target.parent.ripple_mc, "alpha", Strong.easeOut, 0, 100, 24, false);

It seems to be random but eventually after rolling over the several movieclips on the stage the error comes up. Sometimes the alpha setting stops working and will continue to be visible even though it should have stopped and be invisible after 24 frames.

Would love some help on this.

Cheers

#1009 Error Movieclip Inside Movieclip Changing The Alpha Property
Problem:
I'm getting this "TypeError: Error #1009: Cannot access a property or method of a null object reference."
What's happening in the flash file is that I've got a movieclip inside a movieclip and when you roll over one of the movieclips the alpha setting for the movieclip inside the initial movieclip is set to 1, then it transitions out back to 0 over a period of time.

var myTween:Tween = new Tween(event.target.parent.ripple_mc, "alpha", Strong.easeOut, 0, 100, 24, false);

It seems to be random but eventually after rolling over the several movieclips on the stage the error comes up. Sometimes the alpha setting stops working and will continue to be visible even though it should have stopped and be invisible after 24 frames.

Would love some help on this.

Cheers,

Sarge

MovieClip.onRelease = MovieCLip.Protoype Function Fails To Execute Properly
Dear all,

I created a simpe function:

MovieClip.prototype.hiMe = function(me, theRest)
{
//declare the format colors white and grey
formatMe = new TextFormat();
formatMe.color = Colors[0];
formatMe.font = "Adventure Subtitles";

formatTheRest = new TextFormat();
formatTheRest.color = Colors[1];
formatTheRest.font = "Adventure Subtitles";

// assign grey to theRest
for (i =0 ; i < theRest.length; i++)
{
theRest[i].tfield.setTextFormat(formatTheRest);
}
// make the me white
me.tfield.setTextFormat(formatMe);

}

when I call it (bar[0] is an array of objects)
bar[0].invar.onRelease = hiMe(bar[0],bar);

it executes on load regardless of the onRelease eventHandler and the ownards it does not execute when exciting the event.

does somebody know why this may be?

Cheers

DDT

MovieClip.onRelease = MovieCLip.Protoype Function Fails To Execute Properly
Dear all,

I created a simpe function:

MovieClip.prototype.hiMe = function(me, theRest)
{
//declare the format colors white and grey
formatMe = new TextFormat();
formatMe.color = Colors[0];
formatMe.font = "Adventure Subtitles";

formatTheRest = new TextFormat();
formatTheRest.color = Colors[1];
formatTheRest.font = "Adventure Subtitles";

// assign grey to theRest
for (i =0 ; i < theRest.length; i++)
{
theRest[i].tfield.setTextFormat(formatTheRest);
}
// make the me white
me.tfield.setTextFormat(formatMe);

}

when I call it (bar[0] is an array of objects)
bar[0].invar.onRelease = hiMe(bar[0],bar);

it executes on load regardless of the onRelease eventHandler and the ownards it does not execute when exciting the event.

does somebody know why this may be?

Cheers

DDT

#1009 Error Movieclip Inside Movieclip Changing The Alpha Property
Problem:
I'm getting this "TypeError: Error #1009: Cannot access a property or method of a null object reference."
What's happening in the flash file is that I've got a movieclip inside a movieclip and when you roll over one of the movieclips the alpha setting for the movieclip inside the initial movieclip is set to 1, then it transitions out back to 0 over a period of time.

var myTween:Tween = new Tween(event.target.parent.ripple_mc, "alpha", Strong.easeOut, 0, 100, 24, false);

It seems to be random but eventually after rolling over the several movieclips on the stage the error comes up. Sometimes the alpha setting stops working and will continue to be visible even though it should have stopped and be invisible after 24 frames.

Would love some help on this.

Cheers,

User Input Creates MovieClip Made Of MovieClip Symbols
Hello. I need some help either with my situation or with the search terms I'm using to try to find an answer.

I am using Flash MX Pro 2004.
I have drawn letters A-Z in Flash in two different styles (for example one that is furry and another that looks like metal). I would like users to select a text style (furry or metal) and enter text via text input field. When they have pressed an Enter button I would like the word to appear made up of the drawn symbols that I created.

I don't want to make an actual font. Any ideas on search terms to find the sort of thing I am looking for? Here's some that I've tried already:

convert text to symbols -- I get tons of results talking about putting textfields in symbols.

user input to symbols -- almost same results as above

custom fonts using symbols -- I get results talking about how to embed fonts and making text bold, italic, etc. Also not what I'm after.

All help is appreciated. Thanks in advance.

Scott

Receive Full Path To A MovieClip, Return A MovieClip Reference.
Hi, I got this function...

Code:
Function getMCPath(path:String)
{
var MC:MovieClip;
MC = eval(path)
return MC;
}

If I send "_level0" this will return _level0, but if I send "_level0.myMC" this will return undefined.

what should I do in order to get full path to _level0.myMC

Thanks in Advance,
DMZ

How To Hide My Current Movieclip And Display 2nd Dynamically Created Movieclip?
I have a movieclip in which there is an image create this movieclip dynamically by reading the oath of the image from file and play an effect. its working fine, now i want to hide this MC after its effect is ended and then dynamically want to create the other MC and similarly so on. how to do that. my code is as below:

var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this);

lv.load("data.txt");
var my_lv:LoadVars = new LoadVars();
my_lv.load("data.txt");
my_lv.onLoad = function(success)
{
if (success)
{
if(this.pic1!=undefined)
{
var ImgMc:MovieClip = createEmptyMovieClip("ImgMc", getNextHighestDepth());
_root.mcLoader.loadClip(this.pic1,_root.ImgMc);
//Some effect on ImgMc

//how to hide the ImgMc whe nits effect is played and then load another image in a movieclip and so on
}
}
}

Load Movieclip From Libary Into Another Blank Movieclip On Stage (URGENT PLEASE)
hi all i just need to know how to load a movieclip into a blank movie clip all in the same movie?! please help many regards peter thanks in advance!

Movieclip Rollover Effect Disables Internal Movieclip Buttons
Is it possible to have a movieclip rollover effect with another movieclip inside of it that is able to be clicked and do what it's scripted to do?

Let me try to get specific...


Movieclip 1 -- Has www.kirupa.com/developer/mx2004/button_effect.htm applied

Inside of Movieclip 1 --> Buttons that appear visible when you rollover the menu (it comes out of eases into view)

These buttons inside are not being allowed to be pushed because from what I can gather, the complex rollover is not allowing anything to be activated except the rollover effect.

So here's a diagram:

Rollover Movieclip 1 --> Eases it's bottom part up revealing 4 buttons --> These buttons when clicked are supposed to do an action --> Buttons cannot be activated for some unknown reason.

Can anyone help me out? I'm out of ideas after working on this for the past hour or so. If you need any extra info or materials, let me know; I'm sitting right here working on this problem haha.

-Indecisive

Problem With OnRelease For MovieClip Inside Draggable MovieClip [Flash Pro 8]
I have a movie clip, circle_mc, and in it is embed another movie clip, point_mc. I made the circle draggable with this:


Code:
circle_mc.onPress = function() {
startDrag(this);
};
circle_mc.onRelease = function() {
stopDrag();
};
and that part works fine.

I also want to be able to click on point_mc which is within the circle_mc movie clip. So, I added this:


Code:
circle_mc.point_mc.onRelease = function() {
trace("click was successful");
}
This does not work, and I'm pretty sure it is BECAUSE its parent clip is draggable and therefore has its own onRelease function. (If I comment-out the drag code, then the other code works as intended.)

Is there any way to do this or am I out of luck?

How To Load Image Into Movieclip Inside Movieclip That Is Dynamically Created?
Hello Kirupa Cats!

I am building a menu from an XML file, and I'm cool with cyclying thru the xml data to create menu items.

For every menu item in my XML file, I'm using attachMovie to insert a movie clip called menuitem from my library into a movieclip called menuholder. This works no problem, my menuholder movieclip is poplulated with as many menuitem movieclips from the library as designated by the xml data.

However, inside the library movieclip called menuitem, I have another movieclip on its stage, called mc_menuImage. I want to load an image into that movieclip, and I'm taking the URL for the image from the XML data.

My problem is I can't seem to figure out how to fully identify the movieclip mc_menuImage to load the image. It may have something to do with the fact that the library movieclip is being loaded dynamically, but the movieclip inside the library movieclip exisits pysically on the stage. I don't know...here's the code I'm working with:

THE CODE:

var xmlMenu:String = "menu.xml";
menuholder = createEmptyMovieClip("menuholder", -1);

var xmlMenuData:XML = new XML();
xmlMenuData.ignoreWhite = true;
xmlMenuData.load( xmlMenu );
xmlMenuData.onLoad = function(loaded) {
if (loaded) {
var mImage:Array = new Array();
var mRootNode = this.firstChild.childNodes;
totalMenuItems = mRootNode.length;

// fill array
for (var i = 0; i<totalMenuItems; i++) {
mImage.push(mRootNode[i].attributes.menuImage);
}
}

//make the menu
for (var i = 0; i<totalMenuItems; i++) {
var menuitem = menuholder.attachMovie("menuitem", "menu"+i, i);
menuitem.id = i;

/* now here I thought I could just do this: */
menuitem.mc_menuImage.loadMovie(mImage[i]);
/* but that doesn't work... */

};


When I trace menuitem I get this: _level0.menuholder.menu0, _level0.menuholder.menu1, etc, so I figured the syntax menuitem.mc_menuImage would identify the movieclip inside menuitem, but to no avail. Maybe it has something to do with levels, I'm not sure...

So I don't know, any suggestions? Thanks so much!!!

How To Scale The Movieclip Without Transform The Text Inside That Movieclip Uisng As
hi
how to scale the movieclip without transform the text inside that movieclip uisng actionscript


thanks in Advance

Wait Till Movieclip Gets To Particular Frame Then Play Another Section Of Movieclip
Hi,

I'm trying to reconstruct http://www.kswissfreerunning.com/AU/ with movies of my own.

Basically I have an array that contains the letters the user enters and I have the movie in a separate moviecilps with labels representing the letters.

I have a (what I think) logical set of code here to run through each letter in the user enters:

Code:
for(var k=0; k < letterArray.length; k++){
movie_mc.gotoAndPlay(letterArray[k]);
}
The problem is that it will only play the last letter the user enters. How am I able to make my flash wait till it gets to the end of a section of the movieclip, then play the next one, without it rushing to go straight to the last letter.

My pseudocode looks like this:

For the length of the array
play the next letter
when that letter movie gets to the end
play the next letter

Thanks in advance.

[HELP] DuplicateMovie / AttachMovie Movieclip Located Inside A MovieClip To Root
As title.

Example:
I have a movieclip(innerClip) inside a movieclip(mainclip).
Is there anyway if I duplicate / attach my innerclip to my root stage? So I can access it like _root.innerclip2, instead of normal duplication that make to _root.mainclip.innerclip2

Thanks in advance.

Control/sinc Video Movieclip And Text Movieclip
Here´s a tricky one:

I need to sincronize/control a movieclip with texts and a swf (a video) that I loaded, both on the main timeline.

I have a swf (a video) that I loaded in a movieclip into my flash file and a movieclip with texts in it. Both are on the main timeline. Trouble is if the movie is playing and I want to pause it, for example, the swf video pauses but the texts movieclip keeps on playing. If I rewind it, the swf video goes back, the text movieclip still keeps on going. You get the picture.

For control I´m using a camtasia component - camtasia is the software I made the video with. I´m not putting the movie straight into the flash file because the swf made with camtasia turns to be way smaller that if I just loaded into flash.

I´ve attached a txt file with the controller script. Also i´ve put for download the flash file i´m talking about (flashsinc.zip) so you can better understand what I mean. Here´s the adress:

http://www.altoqi.com.br/temp/flashsinc.zip

Thanks a lot.

Trapping Mouse Events For A Movieclip Inside A Movieclip
Hi

Im having a few problems with my events for some movieclips. What I have is an AS2 class which creates a blank movieclip as a holder for submenu movieclips. This blank movieclip must trap its onRollOut event so that it can fade out the menus. The submenu movieclips which are then attached to the holder clip must trap their own mouse events which are defined in another AS2 class. The only trouble is they are not trapped.

I have seen a couple of other posts on the subject but got no clues from them. I was just wondering if what Im trying to do is possible or if Im fighting a loosing battle.

Any help would be much appreciated.
Thanks in advance
Dan

Mouse Event Triggers For Movieclip Inside Movieclip (can It Be Done?)
'canvas' is a large movieclip I am using to put other movieclips 'in' so I can move around and zoom everything at once. Like a coffee table with pictures on it.

I am loading up two images below with variables named map01 and map02. They overlap.


Code:
var map01:MovieClip = canvas.createEmptyMovieClip("map01", canvas.getNextHighestDepth());
map01.loadMovie("http://imagelocation1.jpg");
map01._x=-1000;
map01._y=39;
var map02:MovieClip = canvas.createEmptyMovieClip("map02", canvas.getNextHighestDepth());
map02.loadMovie("http://imagelocation2.jpg");
map02._x=-1000;
map02._y=130;

map01.onRelease = function () {
this.swapDepths(map02);
}
I would like to be able to click one of the images inside canvas and have it jump to the top. In this case, just a simple swap with map02 would be fine, I can manage the depths.

I have put a breakpoint right on the swapdepths line and debugged, and the function never gets called. Probably because it is the onrelease is for 'canvas', not any of the sibling movieclips that flash is looking for.

'canvas' has an onRelease that triggers a stopdrag and a onpress that triggers a startdrag. Removing these two triggers still does not allow any triggers for map01 or map02 to trigger though.

Any suggestions?

Is there some way to setup some logic on a canvas.onRelease function that can easily check to see if the clicked region is on an movieclip inside the canvas?

[F8] MovieClip._currentframelabel Would Be Nice Or, MovieClip.gotoAndStop(_nextlabel)
Ok, so, to my knowledge, up to AS 2.0, there is still no way to return the value of a frame label, correct? Or better yet, why haven't "they" added a "_nextFrameLabel();" or "_prevFrameLabel();" method!?!? Flash has the ability to move the playhead 1 frame at a time just by using the _nextFrame(); and the _prevFrame(); soooooooooo why can't it have the same function, just with frame labels!!!?! e.g. I have a Forward button that would have:


Code:
on(release){
_nextFrameLabel();
}


This would take me to the next frame which has a label, regardless of what it's called... the label could be "c", or "gibblets", or "blahblahblah"...

Or, if there was a property similar to MovieClip._currentframe, which, instead of returning an integer, it would return a string value if the playhead is on a labeled frame! e.g. MovieClip._currentframelabel would return "gibblets" instead of 145.

Basically, if I have a long linear animation with a bunch of manual stops and pauses put into the timeline, I want to avoid having to put a new keyframe in for the "Step Forward" and "Step Backward" buttons every time the playhead reaches a new stop/frame label. Has anyone figured an easier way to do this?

Example:
I have a timeline with 4 labeled frames, A, B, C, D... frame 1 is labeled "A", frame 50 is labeled "B", etc.
I have a layer with a Back and a Next button. So, on frame 50 (labeled "B"), the code for those buttons would be:


Code:
// Back Button
on(release){
gotoAndStop("A");
}

// Forward Button
on(release){
gotoAndStop("C");
}


In order to change that code (e.g. when the playhead gets to the "C" frame) I need to add a keyframe on the button layer... which is fine for this example where I only have 4 sections to deal with... but it's a pain when I have frames "A" through "W" or much more.

Is there a way to dynamically know what the next frame label is with ActionScript without implicitly definining it, thereby removing the necessity for numerous keyframes/code changes for the Back and Next Buttons???

i.e. instead of gotoAndStop("C")... I want gotoAndStop(_nextFrameLabel);

[CS3] Referencing A Movieclip Inside A Movieclip From A Class File
Hello All,

I'm trying to access a movieclip inside another movie clip from a class file that is not attached to either movieclip. For instance, I'm checking hitTests for the avatar the player uses on the game, there are two enemy movieclips. Inside each enemy movieclip is another movie clip that serves as a bounding box (specifically around the mouth of the enemy so it can eat the player). Here is what I have so far that isnt working:


Code:
if (_root['otter']['obbox'].hitTest(this) && touch == false) {
trace("Otter touched Urchin");
gotoAndPlay("hit");
_root['otter'].gotoAndPlay("eat");
touch = true;
}
The class file is for the avatar. On the stage is the otter mc and inside the otter mc is another mc called obbox which is what I'm trying to hitTest against. Needless to say, it doesn't hitTest or trace or play the animation. Is there a way to reference a nested mc? Thanks in advance.

Terror.

Determining The Name Of A Dynamically Loaded Movieclip From A Child Movieclip
I had posted earlier on this topic, but I don't think I was clear enough in my title, or description.

Here's a more detailed explaination of what I I'm trying to do:

I have a .swf file that dynamically generates container movieclips (giving them dynamically generated instance names) and then dynamically loads external .swf files into it.

In my main time line I have a series of objects.

I would like to be able to, from the loaded .swf files, make a call to the objects in the _root timeline (which I can do without a problem) letting these objects know, the name of it's dynamically generated container movieclip that contains my loaded .swf.

1. Parent SWF:
|
2. Dynamically Generated MovieClip Instance:
|
3. Dynamically loaded external SWF File:
. Script needs to know the name of the instance
of #2.

In 3. I tried using the _parent and _parent._parent to get a reference to #2. but all I was able to get was "_level0".

I've also tried using _lockroot (which somone else kindly suggested) to no avail.

Any help is greatly appreciated

Attaching A Movieclip At A Specific Location Inside Another Movieclip
Hello all,

I am trying to attach a movieclip(a) inside another movieclip(b). When (a) is attached it is always attached at the top left corner OR if I use getNextHighestDepth() then the movieclip (a) is attached randomly at different locations. I would like (a) to be attached at the centre of the parent movieclip or at a specific location inside parent movieclip.

Please help me with this. Me a newbie to actionscripting.

Thanks,

Nish

Child Movieclip Staying Within Boundries Of Parent Movieclip
I am trying to create a child movieclip that should only be displayed within the boundaries of the parent movieclip.

Lets say I have a stage of 800x600 pixels. The parent movieclip is 600x400 pixels. When I create a child-movieclip and place it at _x = 650, the movieclip "disapears" as it is outside the boundaries of the parent movieclip.

I'm pretty sure I am doing something wrong in the creation of the child movieclip, but can anyone help me PLEASE!?!

- mortenft

Dynamic Movieclip Resizing With A Textfield Inside Of The Movieclip
Hello,

I've searched past posts in regards to resizing textfields but I was unable to find any help with the problem I am having resizing a movieclip that contains a textfield.

Basically I am dynamically creating an emptyMovieClip, then within that empty movieClip I am then creating a text fielld and populating it with text.

When I try to resize the movieclips instance by clicking on a button and changing the ._width of the movieclip and it fails.

Please help,

frank grimes

Unable To Select Previous Movieclip After Duplicate Movieclip
i have a movieClip and was able to duplicate the movieClip. But now the problem is, after i have duplicated the movieClip i cannot select the previous movieclip which don allow me to move it around. Is there anyway that will allow me to select my previous movieclip after duplicated?

Below is my code:










Attach Code

var mySelection = "";

wire.onPress = function ()
{
this.createEmptyMovieClip("mc1", 90);
duplicate(mc1);
mc1 = attachMovie("idwire", "wire1", 91);
mc1._x = 273;
mc1._y = 196.5;
dragging(mc1);
}

function dragging(mc)
{
mc.onPress = function()
{
this.startDrag(true);
mySelection = this;
}
mc.onRelease = mc.onReleaseOutside = function()
{
stopDrag();
}
}

function duplicate(mc)
{
amount = 50;
while(amount>0)
{
mc.duplicateMovieClip ("mc"+i, i);
i++;
amount--;
}
}

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