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








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!!




KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 05-06-2008, 08:52 PM


View Complete Forum Thread with Replies

Sponsored Links:

Loading External Movies From Inside A Movieclip...
Hi people,

I am in the middle of a project and having a serious problem with the interface.
Basically the interface is consists of a fla movie called index. This looks like a cd set half way of its box, this movie pulls in another fla movie for the cover (cover.fla) and another for the main content (showcase_main.fla). There is also a diary section that I want to load over main content (its called diary.fla). The problem is this: Since the main menu is inside a movieclip on the index stage I can not figure out how to make this menu control the loading of other fla movies (ie diary.fla) into the index stage, basically what I want to do is be able to click on the main menu “diary” so that this loads the diary.fla over the showcase_main.fla on the index stage. I know this may sounds confusing so I have attached the files for someone to look at. Can someone please help? Your time is greatly appreciated. Thanks.

G’luck.

View Replies !    View Related
Loading External Movies From Inside A Movieclip...
Hi people,

I am in the middle of a project and having a serious problem with the interface.
Basically the interface is consists of a fla movie called index. This looks like a cd set half way of its box, this movie pulls in another fla movie for the cover (cover.fla) and another for the main content (showcase_main.fla). There is also a diary section that I want to load over main content (its called diary.fla). The problem is this: Since the main menu is inside a movieclip on the index stage I can not figure out how to make this menu control the loading of other fla movies (ie diary.fla) into the index stage, basically what I want to do is be able to click on the main menu “diary” so that this loads the diary.fla over the showcase_main.fla on the index stage. I know this may sounds confusing so I have attached the files for someone to look at. Can someone please help? Your time is greatly appreciated. Thanks.

G’luck.

View Replies !    View Related
Loading External Movies From Inside A Movieclip...
Hi people,

I am in the middle of a project and having a serious problem with the interface.
Basically the interface is consists of a fla movie called index. This looks like a cd set half way of its box, this movie pulls in another fla movie for the cover (cover.fla) and another for the main content (showcase_main.fla). There is also a diary section that I want to load over main content (its called diary.fla). The problem is this: Since the main menu is inside a movieclip on the index stage I can not figure out how to make this menu control the loading of other fla movies (ie diary.fla) into the index stage, basically what I want to do is be able to click on the main menu “diary” so that this loads the diary.fla over the showcase_main.fla on the index stage. I know this may sounds confusing so I have attached the files for someone to look at. Can someone please help? Your time is greatly appreciated. Thanks.

G’luck.

View Replies !    View Related
Loading A Swf Into A Movieclip Inside Another Movieclip
Hi, i am having a main.swf which has a movieclip in the form of a window. it's instance name is window_mc. this window has an empty movieclip called load_mc and i am trying to load another swf called login.swf into window_mc.load_mc using

window_mc.load_mc.loadMovie("login.swf");

both main and login swfs are having resolution 1000x780.. but wen it is loaded as said above, the texts inside the loaded swf looks very large. the resolution looks as if they are different.. please help me on this... i haven't tried loading movieclips much. but wen i load a swf into an empty movieclip, it wrks perfectly fine...

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
Target Movieclip Inside External Swf
Hi, I need help.

I'm trying to target a movieclip inside a loaded external swf from the main.swf. The external swf is loaded into 'holder' and I want to target 'maintxt' mc which is inside of 'main.bg' mc in the external swf.

I've tried:
Code:

backbtn.onRelease = function(){
  holder.main.bg.maintxt._alpha = 0;
}
But flash doesn't detect the main.bg movie clip. How can I fix it?

Thanks,

ayok

View Replies !    View Related
Loading Xml Inside A Movieclip
hey everyone,

loading an xml file into the main main root works fine. but when i place the load xml function inside of a movie clip, it is no longer functional. why is that?

Kristian

View Replies !    View Related
Using Variables Inside A External Swf, Loaded Into Movieclip
I have the code


Code:
createEmptyMovieClip("sub_mc", 1);
sub_mc.loadMovie("sub.swf");

to load the external swf file. However, the swf file loaded above contains some variables I would like to access in the main movie. These vars are declared on the root of the sub.swf such as
var name = "this";

Writing script on the first frame of the main movie, how can I reference the vars?

I've tried
trace (_level1.name);
but I get "undefined".

Any thoughts?

cheers

View Replies !    View Related
[CS3] Swapdepths Problem; External Swf Inside Movieclip
hi, im using AS 2.0 and i have run into a little roadblock in my current project. basically, i have an external swf with buildings and other things on it, drawn in a 3D view (not actual 3D though) and i am using swapdepths() to layer the buildings in the right order by setting their depth to their _y value, giving objects closer to the camera a higher depth

now, my problem is that i have a character that is also having his depth set according to his _y value, but he is OUTSIDE of my holder movieclip that the external swf is being loaded in to. therefore, the character can move around and his depth is being swapped, however when you walk behind one of the buildings the character is still on top, leading me to believe that the externally loaded buildings are not having their depths swapped.

i think that this is due to the fact that the buildings inside the parent movieclip cannot leave that same parent movieclip, so they are stuck not being able to change depths, unlike my character who can. what i need is help making my buildings also swap. so that they are able to be above the character when he is behind them, and below the character when he is in front of them. i know how this should be achieved, but the fact that they are stuck inside the movieclip is stopping my code from working, and yet it has to be done this way, so i cannot simply dump all of the scenarios into my main file which would fix the problem

any help on getting around the problem of swapdepths being affected by parent movieclips would be greatly appreciated, assuming its at least possible, or suggestions on a workaround, thanks.

EDIT: also, i am sure that the problem is not simply that the building's _y value is too small, as i set one of them to 10000 which should have therefore been on top of everything, but it wasn't...

View Replies !    View Related
Loading Variables For Inside A Movieclip...
How do i load variables from an external .txt file into a movieclip....
It works when i just make a dynamical text field and load the variables, the text comes in the textfield.
But when i make an mc of it... it stops working..
plzz help, i would appreaciate it very much

View Replies !    View Related
Loading Outside Variable Inside Movieclip
I have a movie clip that needs to load an outside Variable and I know how to do it if the Variable is in the main time line.

=========

Main TimeLine:
timedelay = 5;

MovieClip
timedelay = _root.timedelay

===========

What I can not figure out is how to load a variable in a movie clip that is on the Instance of itself (not in the movie clip).

I am fine if I only use one instance of the movie clip at a time on the stage since I can set the Variable on the Main TimeLine into the movieclip (using .root), but this would not work correctly if I want two instances of a movieclip with differenct variables.

Right now I am having to make duplicate copies of a movie clip with different Variable names. I was hoping there would be some way where I could only use one movie clip and give it different variables.

Anybody?

View Replies !    View Related
Loading Outside Variable Inside Movieclip
I have a movie clip that needs to load an outside Variable and I know how to do it if the Variable is in the main time line.

=========

Main TimeLine:
timedelay = 5;

MovieClip
timedelay = _root.timedelay

===========

What I can not figure out is how to load a variable in a movie clip that is on the Instance of itself (not in the movie clip).

I am fine if I only use one instance of the movie clip at a time on the stage since I can set the Variable on the Main TimeLine into the movieclip (using .root), but this would not work correctly if I want two instances of a movieclip with differenct variables.

Right now I am having to make duplicate copies of a movie clip with different Variable names. I was hoping there would be some way where I could only use one movie clip and give it different variables.

Anybody?

View Replies !    View Related
Hi How Make JJumping From Inside MovieClip To External Scene?
Hi! Does someone can help me with such a problem:
http://www.test.w3.com.pl/mikolaj/000mik/xxx.fla
What action should i put at the end of MovieClip [inside] from scene 3, to jump to beggining of Scene 2?
Thanks, Thiefunny.

View Replies !    View Related
Gradient Alpha Masking Inside Movieclip Or External SWF
I'm trying to create a gradient masking effect for one of my flash applications using the technique described here: http://www.devx.com/webdev/Article/29296. Everything works fine as long as I implement it at the root scene level but if I want to embed the mask and maskee into a movieclip or an external SWF and then add that movieclip/SWF to my main scene, the mask is simply not applied and the two elements appear as solid objects.

Has anybody experienced a similar problem? If you have an idea how it could be solved I'd appreciate some help.

FYI, I'm using Flash 8 on Windows and I have Flash Player 9.

View Replies !    View Related
Loading MovieClip Inside Flash Movie
Hi,

I guess i've worked a lot in FlashMX and created quite a bit of things. Including working with Flash & php/mySQL etc., so i wouldn't call myself a newbie, but in this particular case, please strictly regard me as one as i have no clue how to go about.

I have a mainframe interface which had a preloader.
After a certain frame is reached.. on the click of a button, A huge set of images with some interactivity/nagivation are to appear... i want them to Preload .. but only after the Click of that button in the mainframe. If i combine total preloading, it will take a lot of time.. so i want the user to get into something, then when he clicks the button, this particular new movie clip loads.

So this is like a Preloader for Movie Clip which is not preloaded in the initial Preloader for the entire Movie. I have seen this so much in so many places.

Apart from this, there is another problem. Thing is, this new MovieClip is supposed to be controlled/navigated, through buttons in the mainframe system which appear even before this new clip is loaded. When i'll be making ActionScripts for this.. will there be any problem? If i make normal reference to this new Clip. will it work? Or is something specific to be done then?

Thanks...

2Shy

View Replies !    View Related
Trouble Creating A Loading Bar Inside A Movieclip
hey all,

I was wondering how to create a loading bar (or "preloader") inside a movieclip. I've had a try at this by copying the code from tutorials where the loadingbar is on the main timeline.

The main reason the loading bar has to be inside a movieclip is that the loading bar is going to be placed at an angle (as I've found that if you alter the angle of a movieclip the X & Y coordinates of the actionscripting alters along with it).

I basicly need help sorting out the path or route as to where the actionscript is going to get its information... I think. I'm not sure if the correct commands are _root, or _parent, or "this" or this... if anyone can help me with this I think it'll give me a greater understanding of how actionscripting makes objects relate with each other and at what levels.

Right now if I preview it with "show streaming" enabled I see a blank white screen for a while instead of my loadingbar, and then the rest of my movie.

heres the code i've used:


Quote:




bytes_loaded = Math.round(_root.graphics_mc.getBytesLoaded());
bytes_total = Math.round(_root.graphics_mc.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
_root.graphics_mc._root.graphics_mc.loadBar._width = getPercent*385;
if (bytes_loaded == bytes_total) {
_root.graphics_mc.gotoAndPlay(3);
}




thanks

View Replies !    View Related
Loading Text Variables Inside Movieclip
Hello script guru's i really need you help.
I want load text variables to the movieclip inside.
heres the script.




Code:
on (release) {
_root.txtBox.text = "Messages"; \outside movieclip WORKS FINE
_root.contentMc.txtBox.text = "Messages"; \inside movieclip NOT LOADING
}

Thanks in advance..

View Replies !    View Related
Loading Dynamic Text Inside Movieclip
PLEASE HELP!!! I'm in desperate need of assistance. I've been at this for a while and can't figure it out.

I need to:
*Load Dynamic text into a container that (fades in the content and stops). It needs to be controlled by a movie clip acting as a button. I can't figure out how to link up the code so that it works properly. I have five different buttons that will bring up different text each time it is clicked. It needs to fade in with each click. I was able to set it up correctly if everything is on the main timeline, however I have a scrolling banner that has the movieclips (acting as buttons) nested within them and the code will not work. So I am clueless at this point. PLEASE HELP if you know how to do this! I would gladly appreciate it.

Movie clip as button has the following code:









Attach Code

on (release) {
loadText = new loadVars();
loadText.load("text1.txt");
loadText.onLoad = function(success) {
if (success) {
//trace(success);
newsBox.html = true;
newsBox.htmlText = this.myNews;
}
};
}

View Replies !    View Related
Loading Random Movieclip Symbomls Inside An .swf
I'm building a reference archive site for a documentary film (you can see a template example at www.seanmurphydesigns.com/endgame_page.html) and I am featuring on the page a scroller bar in which random quotes from the film will scroll through. If you check out the example page, you'll see the bar directly beneath the masthead graphic, there is a static quote sitting in it now.

I've looked up code that would enable me to randomly scroll .swf's referenced from outside the file, but I've yet to find anything that suggests a way to instead load random movieClip symbols from inside the same .swf. Should I necessarily be using the outside-referenced .swf method? I thought it might be simpler to just use the random symbols which would already be inside the file.

Any ideas/suggestions? Thanks in advance for any help.

View Replies !    View Related
Loading Random Movieclip Symbols Inside An .swf
I'm building a reference archive site for a documentary film (you can see a template example at www.seanmurphydesigns.com/endgame_page.html) and I am featuring on the page a scroller bar in which random quotes from the film will scroll through. If you check out the example page, you'll see the bar directly beneath the masthead graphic, there is a static quote sitting in it now.

I've looked up code that would enable me to randomly scroll .swf's referenced from outside the file, but I've yet to find anything that suggests a way to instead load random movieClip symbols from inside the same .swf. Should I necessarily be using the outside-referenced .swf method? I thought it might be simpler to just use the random symbols which would already be inside the file.

P.S. - Sorry about the thread duplication, I tried to correct a spelling error in the title of my first post and ended up posting this thread twice.

Any ideas/suggestions? Thanks in advance for any help.

View Replies !    View Related
Loading Text Variables Inside Movieclip
Hello kirupa guru's i really need you help.
I want load text variables to the movieclip inside.
heres the script.


Code:
on (release) {
_root.txtBox.text = "Messages"; \outside movieclip WORKS FINE
_root.contentMc.txtBox.text = "Messages"; \inside movieclip NOT LOADING
}

Thanks in advance..

View Replies !    View Related
Button Inside A Movieclip Inside A Scene Help
i have a button inside a movieclip inside scene 1. i want to have the it so when the button is released, it will go to scene 2. can someone help.

View Replies !    View Related
Loading An Image Dynamically Into A Movieclip Inside A Button
Well I am trying to make a component in which i can load an image dynamically. Once done i will be able to zoom in and zoom out as well as pan the image.

The problem is when i use the image directly there is no problem with panning but when done dynamically it does not happen.

to load an image -

_root.ThePic.loadmovie(imgname);

{ ThePic is a movieclip have an invisible button. Inside the button i have another movieclip within which the image gets loaded)

I would appreciate if someone could help me at the earliest.

View Replies !    View Related
Scrollpane Inside Attached Movieclip Not Loading Content
hi folks,

I have a movieclip in my library that contains a scrollpane.

I attach this movieclip to the stage using attachMovie.

I then wish to populate this scrollpane with another movieclip in the library.

It seems that I can only get this to work if i delay the request to populate the scrollpane be either using an interval or some delayed event.

It would appear that I need to first be sure that the first attached movie clip is fully loaded before I can populate the scrollpane it contains (i think)

Whats the right way to do this? I don't want to guess when its "ok" to add content to my scrollpane as this may not be the same on every system. It looks like using "onLoad" with an external class as suggested in the Docs would be a solution, but it seems a bit convoluted and I have yet to get it to work properly.

I'm using flash 8 pro.

please help.

View Replies !    View Related
Scrollpane Inside Attached Movieclip Not Loading Content
hi folks,

I have a movieclip in my library that contains a scrollpane.

I attach this movieclip to the stage using attachMovie.

I then wish to populate this scrollpane with another movieclip in the library.

It seems that I can only get this to work if i delay the request to populate the scrollpane be either using an interval or some delayed event.

It would appear that I need to first be sure that the first attached movie clip is fully loaded before I can populate the scrollpane it contains (i think)

Whats the right way to do this? I don't want to guess when its "ok" to add content to my scrollpane as this may not be the same on every system. It looks like using "onLoad" with an external class as suggested in the Docs would be a solution, but it seems a bit convoluted and I have yet to get it to work properly. (for example, how do you pass to the class constructor a reference to a scrollpane thats contained within the same movieclip thats being attached within the line of code that instantiates said class and its associated movieclip...confused? me to!)

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
#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
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

View Replies !    View Related
[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.

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
Getting A Movieclip To Match The Coordinates Of A Movieclip, Inside A Moiveclip.
Quick question. Is it possible for a movieclip to go to the coordinates (x,y) of another movieclip that is within a movieclip?

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
[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");
}

View Replies !    View Related
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?

View Replies !    View Related
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.

View Replies !    View Related
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..

View Replies !    View Related
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.

View Replies !    View Related
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.

View Replies !    View Related
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!

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