Multiple Movieclips Inside One Movieclip
Hi,
This should be simple but I can't figure it out... I have a master movieclip and I would like to create further movieclips within this one and load images in these. Here is how I did this:
var ThumbHolder:MovieClip = this.createEmptyMovieClip(mcThumbHolder,this.getNe xtHighestDepth());
var Thumb1:MovieClip = ThumbHolder.createEmptyMovieClip(mcThumb1,mcThumbH older.getNextHighestDepth());
var Thumb2:MovieClip = ThumbHolder.createEmptyMovieClip(mcThumb2,mcThumbH older.getNextHighestDepth());
Thumb1._x = 0;
Thumb1._y = 0;
Thumb2._x = 250;
Thumb2._y = 250;
loadMovie("images/thumb_1.jpg",Thumb1);
loadMovie("images/thumb_2.jpg",Thumb2);
The movieclips are created but Thumb1 is not visible, it's hidden under Thumb2! What am I doing wrong?
Any help is much appreciated!
KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 06-16-2006, 01:10 PM
View Complete Forum Thread with Replies
Sponsored Links:
Multiple Movieclips Inside One Movieclip
Hi,
I have the following problem... I would like to create an empty movieclip that will be placed on the form then create a second mvieclip within this first one and then again create multiple movieclips within this second clip. The second clip should work like a carrier for the smaller movieclips (for tweening, etc). Here is how I did it:
var MainHolder:MovieClip = this.createEmptyMovieClip(mcMainHolder,this.getNextHighestDepth());
var ThumbHolder:MovieClip = MainHolder.createEmptyMovieClip(mcThumbHolder, MainHolder.getNextHighestDepth());
var Thumb1:MovieClip = ThumbHolder.createEmptyMovieClip(mcThumb1, ThumbHolder.getNextHighestDepth());
var Thumb2:MovieClip = ThumbHolder.createEmptyMovieClip(mcThumb2, ThumbHolder.getNextHighestDepth());
MainHolder._x = 100;
ThumbHolder._x = 100;
ThumbHolder._y = 100;
Thumb1._x = 0;
Thumb1._y = 0;
Thumb2._x = 250;
Thumb2._y = 250;
Thumb1.loadMovie("images/thumb_1.jpg");
Thumb2.loadMovie("images/thumb_2.jpg");
The images show up OK only that... thumb_2 is covering thumb_1 so this is invisible and I can't move them at all (using the _x property) What am I doing wrong!?
Many thanks in advance!
View Replies !
View Related
[CS3] MovieClips Inside A Movieclip
Flash is making me feel like a damn fool. Granted I've only been using it for a few weeks.
Alright, so I've got a bunch of movieclips inside of another movieclip. Inside the movieclip (called star_mc) I have another movieclip called mcStarburst, that I want to play when I roll over the clip. I have a frame with the stop(); command on the first line.
When I run the thing though, I just get a bunch of errors. I can't click on the thing and get a trace statement in my output, and the starburst animation just plays over and over again, completely disregarding my stop command.
And on top of that not even my buttonMode works right. What gives?
Here are the errors:
1119:Access of possibly undefined property mcStarburst through a reference with static type Function.
1061: Call to a possibly undefined method addEventListener through a reference with static type Class.
1061: Call to a possibly undefined method addEventListener through a reference with static type Class.
1119: Access of possibly undefined property buttonMode through a reference with static type Class.
And here is the code I'm using:
star_mc.addEventListener(MouseEvent.CLICK, onClick);
star_mc.addEventListener(MouseEvent.ROLL_OVER, playStarBurst);
function onClick(event:MouseEvent):void
{
trace("Ok this better work")
}
function playStarBurst(event:MouseEvent):void
{
play.mcStarburst;
}
star_mc.buttonMode = true;
View Replies !
View Related
MovieClips Inside MovieClip
Hi everyone,
Im trying to get the number of mcs that I have inside another one:
Code:
var mc1:MovieClip = new MovieClip();
var mc2:MovieClip = new MovieClip();
var mc3:MovieClip = new MovieClip();
mc1.addChild(mc2);
mc1.addChild(mc3);
for ( var i in mc1 ) {
trace( i ); //this used to work in AS2
}
my problem is that it even doesn't get inside the for loop for the trace... :P
is there any other way to get to the movieclips inside another movieclip?
THKX,
View Replies !
View Related
Clicking On Movieclips Inside Another Movieclip
Hi there,
I'm having a whole lot of trouble with some nested movie clips. Here's the situation.
I'm duplicating movieclips inside a container movieclip. That works fine. My problem is, the onPress event that I assign to them doesn't fire. It appears that the container movieclip is "blocking" it's children movieclips.
I've been trying all the Propagation work-arounds but nothing seems to work.
The Goal: I want to click on one of the "parts" in th left side menu and i want it to trace one of it's properties. At this point, if it traced "Hi" i'd be happy. I just want it to fire when i click on it.
I'm not able to upload the files so you can find them here:
http://www.cybertekresearch.com/sharing/share.html
the files are called Parts.as and parts.fla
I'm pretty sure the pertinent code is between line 81 and 99 of the .AS file.
Thanks
View Replies !
View Related
Perform Action To All Movieclips Inside A Movieclip
Hello all, I have a movieclip with about 50 other movieclips inside it and I want to set all their visibility to false (I can't do this to the parent because I will need to eventually just show one of the movieclips at a time). Is there any type of method I can use to apply, something like mymc.allchildmcs.visibility = false or mymc.mychildmc[i].visibility = false;
View Replies !
View Related
Referencing MovieClips Inside MovieClips From The Main Time Line?
is it possible to have event listeners that listen for a movie clip inside a movieclip and then execute a function from the main time line?
Or is it impossible to relate something this far removed? Sounds like a geek Jerry Springer episode!
Something sort of like this:
Attach Code
movie1_mc.closeBtn1.addEventListener(movie1_mc.MouseEvent.CLICK, closeMenu1);
movie2_mc.closeBtn2.addEventListener(movie2_mc.MouseEvent.CLICK, closeMenu1);
function closeMenu1(e:Event):void {
if (e.currentTarget.name == "closeBtn1"){
movie1.gotoAndPlay(27);
movie1.visible = true;
} else if (e.currentTarget.name == "closeBtn2") {
movie2.gotoAndPlay(27);
movie2.visible = true;
}
}
View Replies !
View Related
Adding Movieclips Inside Of Two Other Movieclips... XML Powered Slideshow
hello..
I have been working on this project that used part of the kirupa.com tutorial for XML slideshows as a base. What it does is takes a set of thumbnails from an XML file and puts them in a movie clip on different layers. (Each thumbnail a new movieclip on a new layer of the original movieclip)
Anyways, what I am trying to do is make a menu movieclip pop up when a button is clicked. Inside this movieclip is where I want to throw the movieclip for thumbnails to load on. The menu movieclip is working fine and whatnot, but I cannot figure out how to get the thumbnails to load inside that second movieclip.
Here is a chunk of my code:
Code:
function createThumbnailScroller(current_mc, currentThumbFile, thumbCenter) {
thumbnail_scroller.createEmptyMovieClip("t"+current_mc, thumbnail_scroller.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(target_mc._width+20)*current_mc;
target_mc.pictureValue = thumbNumb[current_mc];
//trace(thumbNumbforJS[current_mc]);
target_mc.onEnterFrame = function() {
thumbWidth = target_mc._width;
};
target_mc.onRelease = function() {
//tell JS to jump to that slide
flash.external.ExternalInterface.call("jumpToSlide", thumbNumbforJS[current_mc] )
//set scroller movieclip back in its original position (go back to main screen)
yVal = 362;
scroller_move();
};
target_mc.onRollOver = function() {
fadeDown(this);
};
target_mc.onRollOut = function() {
fadeUp(this);
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(currentThumbFile, "thumbnail_scroller.t" + current_mc);
}
"thumbnail_scroller" is the movieclip which is inside of "scroller", the menu movieclip.
Thanks...
EDIT:
I got it working.. I just had to add "_root.movieclipname." in front of the movieclips I referred.
View Replies !
View Related
Adding Movieclips Inside Of Two Other Movieclips... XML Powered Slideshow
hello..
I have been working on this project that used part of the kirupa tutorial for XML slideshows as a base. What it does is takes a set of thumbnails from an XML file and puts them in a movie clip on different layers. (Each thumbnail a new movieclip on a new layer of the original movieclip)
Anyways, what I am trying to do is make a menu movieclip pop up when a button is clicked. Inside this movieclip is where I want to throw the movieclip for thumbnails to load on. The menu movieclip is working fine and whatnot, but I cannot figure out how to get the thumbnails to load inside that second movieclip.
Here is a chunk of my code:
Code:
function createThumbnailScroller(current_mc, currentThumbFile, thumbCenter) {
thumbnail_scroller.createEmptyMovieClip("t"+current_mc, thumbnail_scroller.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(target_mc._width+20)*current_mc;
target_mc.pictureValue = thumbNumb[current_mc];
//trace(thumbNumbforJS[current_mc]);
target_mc.onEnterFrame = function() {
thumbWidth = target_mc._width;
};
target_mc.onRelease = function() {
//tell JS to jump to that slide
flash.external.ExternalInterface.call("jumpToSlide", thumbNumbforJS[current_mc] )
//set scroller movieclip back in its original position (go back to main screen)
yVal = 362;
scroller_move();
};
target_mc.onRollOver = function() {
fadeDown(this);
};
target_mc.onRollOut = function() {
fadeUp(this);
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(currentThumbFile, "thumbnail_scroller.t" + current_mc);
}
"thumbnail_scroller" is the movieclip which is inside of "scroller", the menu movieclip.
Thanks...
View Replies !
View Related
Images Inside MovieClips Inside MovieClips
Hi. I'm trying to create a virtual photo album that you can drag photos into and rearrange them etc. The plan is to have it load/saveable using XML
In my library I have two MovieClips called Page and Photo.
Page is supposed to be able to contain many Photos. A Photo is supposed to hold or be an image (a photo).
I have declared two classes, Page and Photo, which are linked to their respective MovieClips
Actionscript:
class Page extends MovieClip {
private var _photo1:MovieClip;
function Page(){}
public function addPhoto(){
attachMovie("Photo", "_photo1", getNextHighestDepth());
_photo1.loadPhoto("File0025.jpg");
}
}
Actionscript:
import mx.controls.Loader;
class Photo extends MovieClip {
private var _photoLoader:Loader;
function Photo(){}
function loadPhoto(url){
trace("Inside Photo trying to load " + url);
_photoLoader = new Loader();
_photoLoader.load(url);
}
public function onPress(){
this.startDrag();
}
public function onRelease(){
this.stopDrag();
}
}
However, I can't get an image to show. The Photos have to be draggable so they have to be MovieClips. I can't use loadMovie() because I have to abe to control the size of the image. I'm trying to use Loader but I can't get it to work.
Question: What is the best way to allow my Page obj to have draggable images (which I'm trying to do as Photo objects)? I figured it has to use a Loader component.
Advice?
View Replies !
View Related
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!!
View Replies !
View Related
Movieclips Inside Movieclips Problems
hi.
i have a mc called question13 which holds a number of other mc's inside it on the 12th frame, called tick1-tick6. each of these acts as a simple radio button with the following code (for tick1)...
on (release) {
if (_root.tick1select == 1) {
_root.question13.tick1.gotoAndStop(1);
_root.tick1select = 0;
}
else {
_root.tick1select = 1;
_root.question13.tick1.gotoAndStop(2);
}
}
These work fine as they are.
but i need to set the tick1 to look as though it is "ticked" (ie at frame 2) from the main timeline, not within question13, how do i do this?
View Replies !
View Related
Calling Other MovieClips Inside Other MovieClips
The problem I am having is a little moe signifcant than what the titles suggests.
What I am trying to do is to determine whether a movieClip, which is nested inside another a movieClip hits another moviceClip, which, you guessed it, is inside another movieClip.
Something along the lines of this:
Code:
onClipEvent(enterFrame){
if( _root.character.charNose_mc.hitTest( this )){
_root.character._x -= _root.char_speed;
}
}
Obviously this code is not working. The movieClip the hitTest( this ) is referring to is inside another movieClip. And charNose_mc is nested inside character at the root level. As you can tell, the goal of this code is to move the character movieClip in a negative direction using a predefined variable called char_speed.
Any ideas on what I am doing wrong, or what is the proper way to format this code? Thanks!
View Replies !
View Related
Why Do Movieclips Inside Movieclips Have Different _x And _y Than The Timeline?
I'm confused, why does a MC inside another MC have different _x and _y values than the main timeline?
What I am trying to do right now is animate a MC inside another MC then get the main MC holding everything to move where that new MC ended animating at (it's part of a game I'm making.)
I know it's confusing but Flash shows the cursors current X and Y in the info panel, which is the same as the main timeline. Yet inside the movieclip, an x of 76 and a y of 277 on the timeline is -195 and -30.9 (respectively) inside the MC.
How do I fix it so I can get the _x and _y values to match up so I can tell the main MC to reposition itself to the new X and Y (of the inside MC)
View Replies !
View Related
MovieClips Inside Other MovieClips - Detecting All
I have a movieclip called mapWindow, inside mapWindow are dynamically created movieclips of various sizes. The movieclips inside the mapWindow don't take up the entire space of the mapWindow and thus I use a startDrag on the mapWindow upon detection of a mouse press. The problem is, I don't want the start drag to start if the mouse is detected over any of the child movieclips inside mapWindow.
I have a few ideas of how to proceed, but I'm not sure how to reference all child movieclips of a particular movieclip - or something along those lines.
It would be easy to use the hittest function if I knew how to reference all the movieclips I need to, but alas...
Thanks in advance.
View Replies !
View Related
Calling Other MovieClips Inside Other MovieClips
The problem I am having is a little moe signifcant than what the titles suggests.
What I am trying to do is to determine whether a movieClip, which is nested inside another a movieClip hits another moviceClip, which, you guessed it, is inside another movieClip.
Something along the lines of this:
Code:
onClipEvent(enterFrame){
if( _root.character.charNose_mc.hitTest( this )){
_root.character._x -= _root.char_speed;
}
}
Obviously this code is not working. The movieClip the hitTest( this ) is referring to is inside another movieClip. And charNose_mc is nested inside character at the root level. As you can tell, the goal of this code is to move the character movieClip in a negative direction using a predefined variable called char_speed.
Any ideas on what I am doing wrong, or what is the proper way to format this code? Thanks!
View Replies !
View Related
AS3 - Reading Movieclips Inside Movieclips
hey all. i'm such a noob when it comes to AS3 but i'm determined to learn.
i've had to drop out of strict mode to make this work. can someone tell me why? i've a feeling it has to do with casting maybe. this is in an .as file and not on timeline.
trace(getChildByName("box1").playerStats.x);
in strict it throws up "1119: Access of possibly undefined property playerStats through a reference with static type flash.displayisplayObject."
yet trace(getChildByName("box1").x); works just fine.
also i want to refer to it dynamically with "box"+i. do i use this["box+i].playerStats.x?
edit: trace(getChildByName("box"+playerPos).playerCards.x); seems to work ok!
help!
View Replies !
View Related
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
View Replies !
View Related
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 ?
View Replies !
View Related
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
View Replies !
View Related
Multiple SWFs In Multiple MovieClips
So I'm trying to load eight swf files at the same time using eight different movie clips (cause i need to move them around) placed in one big movie clip. I'm using a loop that looks like this :
Code:
for (var i = 1; i<=8; i++) {
this.clip_mc.createEmptyMovieClip("spec" + i + "_mc", 10000+1);
this.clip_mc["spec"+i+"_mc"].loadMovie("species/" + i + "_25.swf");
this.clip_mc["spec"+i+"_mc"]._x = 150;
this.clip_mc["spec"+i+"_mc"]._y = 25*i;
}
The problem is that only the last one (number 8 or in fact any number I put as the last one in the loop) shows up on the scene. I'm pretty sure something is wrong with my syntax but I can't figure out what... any tips?
View Replies !
View Related
#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
View Replies !
View Related
#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
View Replies !
View Related
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!!!!!!!!!
View Replies !
View Related
#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,
View Replies !
View Related
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?
View Replies !
View Related
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!!!
View Replies !
View Related
Movieclips Inside Movieclips
hi.
I am having problems with my game. I want to make bombs and for this i needed a movieclip 1 inside movieclip 2. When movieclip 1 is touched by the player the movieclip 2 plays. I have had no success so far and i cannot use such things as nameing the bomb as it wil take too long because i would like to c +p loads on the game.
Here are the codes i have tried:
code: onClipEvent(enterFrame) {
if(this.hitTest(_root.box))
_root.play ();
}
that made the main frame change.
code: onClipEvent(enterFrame) {
if(this.hitTest(_root.box))
play ();
}
this did nothing
i also tried this but it did not work.
code: onClipEvent(enterFrame) {
if(this.hitTest(_root.box))
_root.this.play ();
}
Have you got any ideas? i tried to provide code and my errors like i must. thanks
View Replies !
View Related
[AS3] How To Access Child Movieclips [movieclip Within A Movieclip]?
I have made a simple fla that
- add movieClip1 on the stage
- moves the movieClip1 from right to left
- when movieClip1 detects a collision with the mouse, it stops.
- when mouse is not in-contact, it continues to move left to right.
The problem I am facing now is...
how do I access the movieClip1_child1_animation2
By default, when movieClip1 is added into the stage, it play
movieClip1 -> movieClip1_child1 -> movieClip1_child1_animation1
NOTE: movieClip1_child1 and movieClip_child2 are not dynamically added via class/actionscript, its already inside movieClip1. Same goes with animation1 and animation2 movieclip, both animations are already in the child1 and child2 class.
http://img100.imageshack.us/img100/5...vieclipzf5.png
View Replies !
View Related
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
View Replies !
View Related
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?
View Replies !
View Related
[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.
View Replies !
View Related
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
View Replies !
View Related
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
View Replies !
View Related
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?
View Replies !
View Related
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("@");
};
View Replies !
View Related
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.
View Replies !
View Related
Visible Of MC Inside Other MovieClips
I use the code blow to load backgrounds only once in my movie as they are needed. I use the function to manage their _visible state so that if the background was already loaded I just make it visible and make all the other visible = false. I got the loading working and it seems that the properties are changing properly too, however I always see only my first background loaded and none of the other ones are showing. Can anybody tell me what is it that I'm doing wrong?
MovieClip.prototype.loadImage = function(instName, level, x, y, width, height, imgPath) {
var myMCL = new MovieClipLoader();
myMCL.onLoadInit = function (targetMC)
{
targetMC._x = x;
targetMC._y = y;
targetMC._width = width;
targetMC._height = height;
};
this.createEmptyMovieClip(instName, level);
myMCL.loadClip(imgPath, this[instName]);
delete myMCL;
};
function addBackground(bgFile) {
if (_root.bg == undefined) {
_root.createEmptyMovieClip("bg", 99);
_root.bg._x = _root.text_scp._x;
_root.bg._y = _root.text_scp._y;
_root.bg.bgCount = 0;
_root.bg.bgArray = new Array();
}
if (showBG(bgFile) == false) {
_root.bg.loadImage("BG" + _root.bg.bgCount, _root.bg.bgCount, 0, 0, _global.defaultMovieWidth, _global.defaultMovieHeight, _global.backgroundImage);
_root.bg.bgArray[_root.bg.bgCount] = bgFile;
//trace("Added New Background: "" + _root.bg.bgArray[_root.bg.bgCount] + "" at position " + _root.bg.bgCount + " with name "" + _root.bg["BG" + _root.bg.bgCount]._name + """);
//trace("Element added has now visible set to "" + _root.bg["BG" + _root.bg.bgCount]._visible + """);
_root.bg.bgCount = _root.bg.bgCount + 1;
}
}
function showBG(filePath) {
var rtVal = false;
//trace("Call ShowBG with count: " + _root.bg.bgCount);
if (_root.bg.bgCount > 0) {
for(i = 0; i < _root.bg.bgCount; i++) {
//trace("Element " + i + " has " + _root.bg.bgArray[i] + " and we are setting visible to "" + (_root.bg.bgArray[i] == filePath) + """);
_root.bg["BG" + i]._visible = (_root.bg.bgArray[i] == filePath);
rtVal = ((rtVal) || (_root.bg["BG" + i]._visible));
//trace("Element " + _root.bg["BG" + i]._name + " has now visible as " + _root.bg["BG" + i]._visible);
}
}
return rtVal;
}
View Replies !
View Related
Buttons Inside Movieclips
Hi, using FlashMX(6) here and i am having trouble with buttons inside movieclips. I have a basic dialog in the form of a MC that comes up with "ok" and "cancel" options. Within my Actionscript i have
EXAMPLE;
attachMovie("NewDialogue","myDialogue",2);
myDialog.OKButton.onRelease = function(){
myCode;
}
Here is the thing. It works perfectly fine when the dialog is called up from the main script (like above), either within a function or outside.
But when this dialog is attached via clicking on another button, the Dialog appears but the buttons not longer work when you click them.
EXAMPLE;
attachMovie("NewButton","Button",1);
CreateDialogueButton.onRelease = function(){
attachMovie("NewDialogue","myDialogue",2);
}
All i can think of it resorting to Hit-testing, but i would prefer to find out why my current method does not work.
Thanks for your time
irreal
View Replies !
View Related
Buttons Inside Movieclips
ok, so i'm making a site, for the links banner i have a movieclip that scrolls in a infinite loop. the banner is a single image and i'm using invisible buttons over the different parts for the links.
the problem is that even though i know the code on the buttons is correct, they just don't work. my guess is that it has something to do with the fact that the buttons are inside another movieclip. the movieclip the buttons are inside already have some code that uses the mouse (it's one of those deals where the position of the mouse over the movieclip determines the speed the movieclip moves at). i think that since the outer movieclip is already using the mouse, it's blocking the buttons inside it from getting recognized.
but that's just my guess. any help would be great.
thanks.
View Replies !
View Related
Preloader Inside Movieclips?
Hi,
I've made a movieclips gallery, where each button plays another movieclip. the problem is a few of the movieclips are quite big and runs slowly. how can I create a preloader inside the movieclips?
thanks in advance,
uriash
View Replies !
View Related
Embed 2 MovieClips Inside Of 1
Hey.
At the moment, I think I may have figured out my problem, but maybe I haven't. I need to get this thing to work if I want it to work. I was wondering if I have 2 movie clips, each holding an image loaded by loadclip where the second image is supposed to be 80 pixels below the first, how I would make it so that these are combined into 1 new movieclip object
Thank you.
View Replies !
View Related
Buttons Inside Movieclips
Hello everybody....
I am relitivley new to Flash and using action script and I am having a problem getting the buttons in my menu to work.
I have a menu which slides in from the bottom when a invisible button is rolled over and slides out when you rollout of the menu, this works fine....
inside this movie clip I have 5 navigation buttons which fade in when the menu has slided out completely but the problem is they dont work....
I have tried putting the code on the keyframe of the mc when the menu is fully out and is in a static position and also inside the buttons themself but neither worked....
Code:
contact_btn.onRelease = function(){
getURL("http://google.co.uk");
}
Code:
on(release){
getURL("http://google.co.uk");
}
I can make working buttons on the main stage no problem but I am pulling my hair out trying to get buttons that are inside a movieclip to work, am I going about this the wrong way or have I missed something?
any help is greatly appreciated.
View Replies !
View Related
Buttons Inside Movieclips
I have a movieclip named blueHome...
in my first frame, I use the following code:
Code:
blueHome.useHandCursor = false;
blueHome.onRollOver = function () {
blueHome.gotoAndStop(2);
}
blueHome.onRollOut = function () {
blueHome.gotoAndStop(1);
}
in frame 2 of blueHome, I have 3 buttons that don't work (as in, when I rollOver them, the hand cursor does not appear, the buttons do not switch to the "Over" frame, and when I attempt to click on them, it doesnt work...
Why is this happening, and what can I do to make the buttons work?
I've tried moving the buttons outside the movieclip and into a frame just above it (so that when I rollOver the movieClip, it makes the buttons visible, and when I rollOut, it makes them invisible)...but the problem is, when I rollOver the buttons, then macromedia treats it as if I've rolled out from the movieClip...
are there any other options?
View Replies !
View Related
Movieclips Inside Sprites
for some reason i get errors when i try to put movieclips inside sprites...
like
Code:
package com.Huh
{
import flash.display.Sprite;
import com.Huh.Innards;
public class Wow extends Sprite
{
public function Wow()
{
var myInnards:Innards = new Innards();
addChild(Innards);
}
}
}
and then
Code:
package com.Huh
{
import flash.display.MovieClip;
public class Innards extends MovieClip
{
public function Innards()
{
trace('im here');
}
}
}
doesn't let me. i guess if there are ANY movieclips inside something all the parent display objects MUST be movieclips? is that true?
or am i just missing something here...
ty in advance!
View Replies !
View Related
Buttons Inside Movieclips
I nested my footer buttons inside a movie clip so that I could align them all to the bottom of the stage without changing their distribution to one another. However, when I test my flash movie these buttons are not affected by a mouse rollover or when they are clicked. How can I get a button's down/over roll over effects to act from within a movieclip? I've attached the fla source so u can better understand my dilemma. All suggestions welcome n thanks in advance for the help!
View Replies !
View Related
|