How Do You Go To The Next Scene Inside The MovieClip?
Can you please help me with this to finish my animation??
I made a dragging function that you can drag stuff into a box or something, but when I release the drag object onto the box I want it to keep playing onto my next scene.
I control it with ActionScript that if the drag object is released onto the box I will play the MovieClip in the box. But when it FINISHED playing the animation in the MovieClip, I want it jump into the next Scene.
I don't know if this is an ActionScript question so I just put it here. I typed in the ActionScript: Code: nextScene(); . It works OUTSIDE of the MovieClip but doesn't work INSIDE of the MovieClip of something. So how can I make it jump off the MovieClip and into the main scene?
Please try to solve my problem!
Thank you very much to people who have helped me!
ActionScript.org Forums > Flash General Questions > Other Flash General Questions
Posted on: 01-03-2005, 09:44 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
How Do I Target A Scene From Inside A Movieclip?
As in the subject: How do I target a scene from inside a movieclip?
I'm in scene 3 called game.... how do I get a movie clip to goto scene 4 named looser?
I tried
Code:
_root.nextScene ();
Any ideas?
Goto Next Scene From Inside A Movieclip?
Hi all, is there a way to go to another scene from inside a movieclip?
I tried with gotoandstop scenename frame 1
But it didn't work
Thought because it a movieclip and it's not on the main scene...
so there is a way?
Thank you in advance
Button Going To Scene From Inside Movieclip
Hi Guys,
I'm trying to help someone with flash roots.
We have a button that wants to go to scene 2.
It is located here:
Scene 1>Rollmov>mov1>button1
All we want it to do is go to scene 2, can't figure out the root thing.
Pdue.
GotoAndPlay Scene From Inside A Movieclip
I have a movieclip one_mc on stage.
Inside one_mc there is another movie clip two_mc.
Inside two_mc there is a button.
On click of this button, i want to goto a scene called "try".
I tried this:
_root.gotoAndPlay("try",1);// it dosn't work.
Any Idea?
Thanks
Controling Scene From Inside Movieclip
Hello...
I have a movie scene (Main) that has a movie clip (MC) plaing in it...
MC has a button that is meant to dictate where in Main to go to; the standard "on release go to and play frame x of Main" does not work, I assume because it is not a seperate scene... can anyone tell me how to control a scene from inside a movie clip?
The Bird from Down Under
bigbird_3156@optushome.com.au
Moving To Next Scene With Button Inside Movieclip
This is probably something easy that I am neglecting, but it's totally driving me nuts:
I have a button within a movie clip which I am using to control the main timeline via "_root". This is working fine except that it refuses to work when I want to to goto a frame in another scene. My syntax is thus:
on (release) {
_root.gotoAndPlay("About", 1);
}
"About" being the scene I want to goto. However when I click the button literally nothing happens. I've tried romoving "_root" but that sends me to the first frame of the movie clip, totally ignoring "About". Any help on this one would be great.
Thanks!
Navigate From Button Inside Movieclip To A Scene?
I have a clip called "scrollbar" sitting on the main timeline (a scene called "Main). I am wanting that button to change to the Scene "Project1" from wherever it is.
Here's the code I am currently using:
on (release) {
_root.gotoAndPlay("Project1","p1.01")
}
Any ideas why this isn't working?
Loading An External Swf Inside A Movieclip That Is Inside Of A Movieclip
I was wondering if anyone could help me!!!! I used the tutorial for loading external swf's into a movieclip off of this site. But what I am trying to do is load another external swf inside of that external movieclip. Not sure if that makes sense. I kind of have it working where it loads the first external clip. But when I press a button to load a different one, it plays the transition then loads nothing. It's just blank.
This is the AS 2.0 that I am using for the external swf button that is inside another:
on (release) {
if (this._parent.currMovie == undefined) {
this._parent.currMovie = "StrategicPlanning2";
container2.loadMovie("StrategicPlanning2.swf");
} else if (this._parent.currMovie != "StrategicPlanning2") {
if (container2._currentframe>=container2.midframe) {
this._parent.currMovie = "StrategicPlanning2";
container2.play();
}
}
}
And this is the AS that I am placing on the last frame in the actions layer
this._parent.container2.loadMovie(this._parent.cur rMovie+".swf");
Please help!!! I am only a Graphic Designer!!
SCENE INSIDE A SCENE? How Does It Work
Hello out there. I'm trying to make a site with a menu and the buttons link to scenes inside the same scene as the menu. Do you get ot. Maybe it's not too clear. Instaed of changing scenes by ckicking on the buttons I'd like for example the likedn scene to appear underneath my menu. Checi it out for example
http://www.dysby.com
or http://www.rekordsrekords.com
Something like that. Thanks alot already.
Rotating Movieclip Inside A Button, Inside A Scrolling Menu Bar
Hi all,
I'm pretty new to actionscript, and I'm kinda moving along; up until now.
I've used the the infinite scrolling menu tute at kirupa.com, created my own button graphics, and have a nice scrolling menu. On the buttons, I'm adding an image (which seems to need to be a movie clip to work), so when you rollover the button, the image will spin.
The code for the spinning works. I've tested it on the root frame of a new movie, and in the button of the infinite scrolling menu movie. I've added the code to spin the image on the "over" frame of the button timeline. With the button scene open, I run "test scene", stop it, and move between the frames. When I advance to the rolloever frame, the image spins like a top, but when I test it from the root of the movie, the image does not spin. I've also added a color change "that works" from the root when you rollover the button, but the not the spinning image.
I've added the image by editing the button from the library. I select the image, and add the code inside an onClipEvent(enterFrame) action.
I've also tried adding the code to the keyframe of the root scene in layer 1, and tried calling the image by the full path (_root.one_button.buttons.button1.spin1._rotation= blah) thinking it needs to know exacty where the image(movie clip) is at in the heirarchy to no avail. I've even went back and gave everything an instance name up unto the button I'm trying all this on.
Any help would be appreciated, since I'm about ready to shed tears over this.
Thanks!
-Sam
OnRollOver() Inside MoveClip Inside MovieClip Doesnt Work
could someone help with this. i dont know why the onRollOver function doesnt work for my submenu button. trace("over main btn") for mainmenu button works fine but trace("over submenu btn"); doesnt work :/
ActionScript Code:
CreateMainMenu = function (x, y, depth, node_xml) {
var cNode;
var cItem;
var cMenu = this.createEmptyMovieClip("mainMenu", 0);
for (var i = 0; i<node_xml.childNodes.length; i++) {
cNode = node_xml.childNodes[i];
cItem = cMenu.attachMovie("mainMenuBtn", "mc"+i, i);
cItem._x = menu_x+i*(cItem._width+5);
cItem._y = menu_y;
cItem.menuname = cNode.attributes.name;
cItem.node_xml = cNode;
if (cNode.nodeName != "menu") {
cItem.arrow._visible = false;
}
cItem.onRollOver = function() {
this.gotoAndStop(2);
h = 0;
clearInterval(newInt);
trace("over main btn");
subMen = this.createEmptyMovieClip("subMenu",200);
newInt = setInterval(openSubMenu, 50, this._x,this._y,subMen,this.node_xml);
}
cItem.onRollOut = function() {
this.gotoAndStop(1);
this.subMenu.removeMovieClip();
};
}
};
openSubMenu = function (x,y,clip,node) {
if(h<node.childNodes.length) {
subM = clip.attachMovie("subMenuBtn","subBtn"+h,300+h);
subM.menuname = node.childNodes[h];
subM._visible = true;
subM._y = subM._height*(h+1);
subM.onRollOver = function() {
trace("over submenu btn"); //<------------- it doesnt work :(
}
h++;
} else { clearInterval(newInt); }
};
var menu_x = alertArea._x;
var menu_y = alertArea._y;
menu_xml = new XML();
menu_xml.ignoreWhite = true;
menu_xml.onLoad = function(succeed) {
if (succeed) {
alertArea._visible = false;
CreateMainMenu(menu_x, menu_y, 0, this.firstChild);
} else {
alertArea.alert = "error: XML not successfully loaded";
}
};
menu_xml.load("menu.xml");
sample xml file for this menu:
ActionScript Code:
<?xml version="1.0"?>
<menu name="XML Menu">
<menu name="firm">
<item name="about" link="http://#"/>
<item name="portfolio" link="http://#"/>
<item name="contact" link="http://#"/>
</menu>
</menu>
does anybody know what is the problem ?
Rotating Movieclip Inside A Button, Inside A Scrolling Menu Bar
Hi all,
This question is going ignored in some other boards, so I thought I'd try here....
I'm pretty new to actionscript, and I'm kinda moving along; up until now.
I've used the the infinite scrolling menu tute at kirupa.com, created my own button graphics, and have a nice scrolling menu. On the buttons, I'm adding an image (which seems to need to be a movie clip to work), so when you rollover the button, the image will spin.
The code for the spinning works. I've tested it on the root frame of a new movie, and in the button of the infinite scrolling menu movie. I've added the code to spin the image on the "over" frame of the button timeline. With the button scene open, I run "test scene", stop it, and move between the frames. When I advance to the rolloever frame, the image spins like a top, but when I test it from the root of the movie, the image does not spin. I've also added a color change "that works" from the root when you rollover the button, but the not the spinning image.
I've added the image by editing the button from the library. I select the image, and add the code inside an onClipEvent(enterFrame) action.
I've also tried adding the code to the keyframe of the root scene in layer 1, and tried calling the image by the full path (_root.one_button.buttons.button1.spin1._rotation= blah) thinking it needs to know exacty where the image(movie clip) is at in the heirarchy to no avail. I've even went back and gave everything an instance name up unto the button I'm trying all this on.
Any help would be appreciated, since I'm about ready to shed tears over this.
Attached is the zipped fla file
Thanks!
-Sam
#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
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!!!!!!!!!
#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,
Linking Movieclip Scene 1 To Scene 2
Hi everyone,
Just wondering how you link from a button in a movieclip in scene 1 to scene 2, this is probably really easy but i can't think right now.
Accessing A Movieclip On Scene 2 From Scene 1
I am trying to make a movieclip that is located on Scene 2, invisible from Scene 1.
code:
on (release) {
_root.movieclipname._visible = false;
}
Using "_root" doesn't work. How can I do this?
Thanks.
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!!!
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?
[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.
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
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
SetProperty Doesn't Work With Movieclip Inside Of Movieclip
I originally had this set up this way and it worked.
var hita:Boolean = false;
logotop.onEnterFrame = function() {
hita = this.hitTest(this._parent.middle.hitme);
if (hita == true) {
setProperty ("logotop", _alpha, "0");
}
}
Then I put everything in a new movieclip with the instance name "printme".
Now it doesn't work and doesn't give me an error.
var hita:Boolean = false;
printme.logotop.onEnterFrame = function() {
hita = this.hitTest(this._parent.printme.middle.hitme);
if (hita == true) {
setProperty ("printme.logotop", _alpha, "0");
}
}
Do you see anything wrong with the above code?
Major Issue: MovieClip Inside Movieclip Will Not Have MouseEvents?
Hey guys, I got this empty MovieClip i add to the stage called 'container'. In container, I also dymaically add warrior(), warrior2(), and warrior3(). Now Im trying to add my rollover state for warrior, however, it never works?
When I place the warrors inside of a container in design time and then attach the code and place it on the stage, it works? Any Ideas?
public function addHitState(container:MovieClip, linkage_name:String, id_name:String):void{
var class_definition:Class = getDefinitionByName(linkage_name) as Class;
var added_clipisplayObject = new class_definition();
added_clip.name = id_name;
container.addChild(added_clip);
added_clip.x = 1151.2;
added_clip.y = 407.8;
added_clip.buttonMode = true;
added_clip.addEventListener(MouseEvent.ROLL_OVER, rollOverFunction);
};
private function rollOverFunction(event:MouseEvent):void{
trace("@");
};
Apple A Color Transformation To A Movieclip That's Inside Another Movieclip
Hey,
I have a movieclip with it's .mouseChildren property set to true. In that movieclip are about 30 other movieclips, and inside each of those movieclips is a single dynamic textfield. I did this so I could set the .buttonMode to true on the 30 movieclips that are in the main movieclip so I could have the nice pointer finger/glove. When I mouse over the main movieclip the pointer finger/glove shows up as it's supposed to. What I want to do is apply a color transformation to the movieclip as I mouse over it. Here's what I have that isn't working:
Code:
function onFeedMouseOver(e:MouseEvent):void
{
var feedColorOver:ColorTransform = e.target.colorTransform;
feedColorOver.color = titleTextOverColor;
e.target.transform.colorTransform = feedColorOver;
}
I have verified that the function is indeed being called, and the color variable is working.
Any help would be very much appreciated.
P.S. The project is a rss reader where the user can select what feed they want to view from a scrollable list that is parsed form an xml file, then the feed will load and display the title, date, and short description of all the feeds for the user. Then it scrolls through them (it loops continuously). When the user clicks on the feed, it takes them to the article/blog post/whatever in a new tab or window. Everything works great, this is basically the last thing I need to do for it. This particular portion of the project is when the user mouses over the list of feeds.
MC Inside Scene 2
I'm trying to use tellTarget to navigate back to the _root in Scene 2!
I have two scenes, scene 1, and scene 2, and my movie clips in scene 2.
Here's the code I'm currently using from within my movie clip in scene 2:
tellTarget (_root){
gotoAndStop("Scene 2", 53);
}
-This works but it takes me back to the main _root which is Scene 1.
How do I get back to Scene 2 from the movie clip within Scene 2 without going back to Scene 1?
[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");
}
Movieclip Inside Movieclip Not Responding To Keypress
I am a beginner with Flash. I am using Flash 8 and am trying to make my very fist arcade game. I am starting with basic keypress and movement. Can't get this to react how I want. I attached the actual .fla file(if I attached it correctly). The movement doesn't include LEFT, RIGHT, UP or down or anything like that. It is only "two" movements. When the user is not touching the keys, the movie clip of the character is sent to his standing pose, which is a moving animation of him swaying back and forth. When the user presses the spacebar, he punches. This is the code, which works fine:
onClipEvent(enterFrame)
{
if(Key.isDown(Key.SPACE))
{_root.subzero_man.gotoAndStop("punch");
}
else
_root.subzero_man.gotoAndStop("standing");
}
This code is attached to the movie clip which is on the main Stage, main Timeline.
The problem is this: you have to be HOLDING DOWN the spacebar to see the punching occur. I don't want the user to have to hold down the spacebar. I want the user to be able to TAP the spacebar and the punch movie clip plays completely(within its own independent timeline).
So I changed the 4th line in the code to this:
{_root.subzero_man.punch_instance.play();
The name of the character on the main timeline is still "subzero_man", and now the name of the instance of the character punching is "punch_instance".
However, nothing happens. The character stays in his standing pose, ignoring the spacebar keypress.
I thought this was the correct syntax for referring to a movieclip instance which is inside another movie clip. In this case, the punching movie clip instance is inside the subzero character movie clip instance which is on the main timeline.
Is my code wrong?
Path Confusion To Movieclip Inside Another Movieclip
I'm trying to get the right path to my embedded movieclips.
I have movieclips (I'll call baby1_mc) loading into another movieclip (I'll call it the momma_mc)
Then from the main time line I want to check if the movieclip that loaded is baby1_mc or baby2_mc, etc.
How do I target the babies to check which moviclip they are?
Thanks so much!
And if you have any questions, just let me know.
Accesing Movieclip Inside Movieclip With Dynamic Name.
Hi,
I have a movieclip which is nested inside a movieclip. now i am creating instance of parent movieclip in a loop and giving it a dynamic name.
now i need to hide the child movieclip nested inside the parent movieclip with dynamic name. this is what i am trying to do
ActionScript Code:
function doThisFunction(e:Event) {
var getIdonClick = e.currentTarget.name; // getting the instance name of movieclip on its click
getChildByName(getIdonClick).bg_tag_us.visible = false; // trying to hide the movie clip with instance name bg_tag_us.
i get an error while compiling ...
ActionScript Code:
1119: Access of possibly undefined property bg_tag_us through a reference with static type flash.display:DisplayObject.
can anyone help in accessing the child movieclip..
Editing A Movieclip Inside A Movieclip & Classes
Hey guys,
iv created a movieclip (let call it movieclip ParentClip) inside my .fla file, and i made my movieclip out of 3 other movieclips (Lets call them ChildClip1, ChildClip2, ChildClip3). I have made a parent class called 'BaseMovieClip' and each Child Movieclip has its base class set as 'BaseMovieClip'.
So does anyone know how 2 access the movieclips that are in ParentClip?
thanx in advance
btw, im creating a 3d flash engine, what does everone think of that? worth it? its going well so far, about 80% done.
How To Reference To A Movieclip Inside An Attached Movieclip
Hi,
I have a button who has to attach a movieClip myMc who contains another movieClip box.
I'm trying to assign an onRelease action to the movieClip inside the Attached movieClip, but it doesn't works.
The code:
PHP Code:
myButton.onRelease = function(){ var ref:MovieClip; ref = container.attachMovie("myMc","newMc",this.getNextHighestDepth());}ref.box.onRelease = function(){ trace("hello world");}
How can i reference to the box movieClip?
By the way, If i try something like this everything works fine:
PHP Code:
var ref:MovieClip;ref = container.attachMovie("myMc","newMc",this.getNextHighestDepth());ref.box.onRelease = function(){ trace("hello world");}
I guess the problem is to attach the movieClip in the button event, but this is what i need.
Checking HitTest With Movieclip Inside Movieclip
I have a game where different movieclips are loaded randomly from an array in to a movieclip call flavors and move across the stage. Flavors is then loaded into the main timeline. I'm trying to test if a movieclip called "butterscotch" is loaded into the flavors movieclip and hits another movieclip called "butterscotch_tube". If it hits the right tube, the it adds one point, if it hits the wrong tube, all points are erased.
Here is the code inside Flavors:
Code:
var flavors:Array;
var thisFlavor:MovieClip;
flavors = [new creamSoda_mc(), new rootBeer_mc, new strawberry_mc, new cherry_mc, new watermelon_mc, new grape_mc, new bubblegum_mc, new butterscotch_mc, new cottonCandy_mc, new raspberry_mc, new sourApple_mc, new chocolate_mc, new mystery_mc];
thisFlavor = flavors[Math.floor(Math.random() *flavors.length)];
addChild(thisFlavor);
Here's the checking in the main timeline:
Code:
if(flavor.thisFlavor.hitTestObject(tubes.butterscotch_tube))
{
if(flavor.thisFlavor == thisFlavor[7])
{
butterscotchScore ++;
trace("butterscotch = " + butterscotchScore);
flavor.removeEventListener(Event.ENTER_FRAME, hitTube);
}
else
{
butterscotchScore = 0;
trace("butterscotch reset");
flavor.removeEventListener(Event.ENTER_FRAME, hitTube);
}
}
The problem, I believe, is in (flavor.thisFlavor == thisFlavor[7]).
thisFlavor is giving me an error, and I don't know what to put in the parenthases to get this working.
Thanks so much for your help in advance!
How To Play/stop A Movieclip Inside A Movieclip?
This is probably really simple and stupid but I can't figure it out. I'm trying to play a movieclip exported from my library which inside a movieclip on the stage.
Code:
//create container MC
var myContainer:MovieClip = new MovieClip();
stage.addChild(myContainer);
//bring in animated MC from library and load into container
var myAnimatedMC:AnimatedMC = new AnimatedMC();
myContainer.addChild(myAnimatedMC);
//play mc?
myContainer.myAnimatedMC.play();
The movieclip is added onto the stage but it just won't play. The last step doesn't work? Any ideas?
Movieclip Inside Movieclip (Timeline Problem)
Temp link to the swf file:
http://avflower.com/
Fla file (rar archive): (deleted)
Click to the fish, so, the top part of the fish would break and stop. Please, help me to change the AS3 code the right way.
Movieclip Inside Draggable Movieclip Won't Work
I have searched and cannot find this solution so I turn to my friends here. How do I trigger movieclip1 inside movieclip2 while keeping movieclip2 "draggable"? Right now the dragging works but I cannot trigger movieclip1. I am using AS2 but might be lured into using AS3 if it makes things easier. I need to start learning it as some point.
Thanks for your help,
Chris
Jumping To A New Scene From Inside A MC
hello, please help if you can.
I'm in a MC (_root.myMC) in scene_1 and want to jump to frame 1 in another scene (scene_2) on the click of my button - could anyone please tell me the code I need to make this jump?
thanks, johne.
How To Play A MC Inside Another Scene
hi all i have two scene (1 is first then 2 )
i am now on the root of scene 2
there a buttom
what will be the action to tell the buttom goto and play frame number 10 in the MC named mc1 in the scene 1 ????
Goto Scene 2 Using A Button Inside A Mc
Hello!!! I have two scenes. In scene1 I have a mc that has a button inside. In this button I put the actionscript
onmouseevent(release)
gotoandplay("scene2",1)
I would like to know why the event doesn´t work. It because the button is a mc? The levels?
How can I go to another scene through a button that is a movieclip?
The LoadMovie works, but GoTo doesn´t.
Thanx!!
Carol
:-)
|