Have Bright Colors Of A Child Clip "poke Through" A Darkened Parent Clip
I am not talking about masks, but was wondering if there is any way to restore, or brighten a child clip (without muddying the colors) that is inside a parent clip that has had its brightness turned down with a colorMatrixFilter?
Let's pretend:
darkBox_mc lightBulb_mc
I put the lightBulb_mc inside the darkBox_mc, and set the box (and all of it's contents) dark by using a colorMatrixFilter, either adjusting the scale values of RGB, or the offset (still not sure how they differ).
So the lighbulb, when off, appears dark because the parent clip had its colors darkened.
Then, i would like the lightbulb to appear to turn on, essentially restoring the color value (or amplifying beyond its initial colorMatrixFilter) to its bright, natural state.
I guess the same effect I am going for is say I make a parent clip alpha 0, or.1 or something real low. Can i go through the child clips inside the near invisible parent, and make them appear normal again? Still keeping them inside the clip? Perhaps offset the alpha by overshooting the 0-1 range? alpha 3.5?
I could have sworn this was possible with some method. Convolution maybe?
ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 09-30-2007, 09:59 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Controling An Instance In A Parent Clip From A Child Clip? ANY Help Appreciated.
I'm sure this is simple, but I'm stuck.
I have an swf file called "base.swf", in which is an instance called "nav" which I need to move around _x and _y. "base.swf" loads a child called "navbuttons.swf". I need to use a button in "navbuttons.swf" to reach back to the parent "base.swf" and interact with the "nav" instance.
I tried the following on the button in "navbuttons.swf";
Code:
on(release){
_parent.nav.xpos=670;
_parent.nav.ypos=375;
}
I was thinking that since base.swf loads navbuttons.swf that the _parent part on the button would get me back to the parent, and the .nav part into the instance I want to control... but it's not working. I tried _root instead of parent with no luck.
I'm sure this is simple, can anyone point me in the right direction?
Assign Actions To Both Parent Clip And Child Clip?
Hello, i need to find a way to add actions to both a parent and child clip.
I ultimately need the entire nav to zoom in when rolled over, and the clips inside the nav have an onRelease function assigned. Any suggestions?
Control Parent Clip From Child?
I have a child clip -- "base"
and a parent clip -- "form"
I want "base" (which is on "form"s frame 90) to tell form to go to frame 46.
How do I do this?
~DW~
Reference Child Clip From Parent
I'm using actionscript 2.
I have a main movie clip. In that movie clip I have 2 children movie clips. I want the 2 children clips to be able to control each other upon clicking buttons.
This code has been placed in the main movie clip:
home.map_btn.onPress = function ()
{
loadMovie("http://apsleycottage.com.au/flash/town_location.swf", movie_holder_mc);
};
The map_btn is located in a child swf called home. The home swf is dynamically called into the place holder called left_movie_holder_mc which is located within the main clip.
I want the main movie to register a click of that map_btn and replace a the movie currently in the movie_holder_mc with a new one called town_location.
What I have done does not work and I am not sure if I have referenced the the button properly from the main movie. I would appreciate any help.
The temporary page is located at:
http://apsleycottage.com.au/Apsley_Cottage3.html
Cheers
Crossy
Problem W/child And Parent Clip
Hello All,
I am having a problem controlling a child movie clip from the parent's timeline. I have all the scripting taking place in frame one of the parent and I want to make the child play with the following syntax:
ActionScript Code:
_root.projMas1.pd_f5_1.onRollOver = function() {
_root.projMas1.projMot_2.Play();
};
Again, this syntax is in frame 1 of the parent movie clip and the button instance "pd_f5_1" is in frame 10.
I went with absolute paths because I didn't see the instance name of the button "pd_f5_1" in the target popup dialog box when the Relative raido button was enabled.
The only way I could make things work is if I envoked the actions on the button instance itself and not the parent timeline.
Can I not control the child from the parent timeline in this way...I wanted to keep all the code in the frist frame...do I have to move the code to the button instance?
Sincerely,
(jw.)
Help: Assigning Event Handlers To Parent And Child Clip, Possible?
I am creating a UI today that has a fairly complex interaction.
And I need to do roughly the following:
Assign onRollOver/onRollOut event handlers to mcParent
Assign onPress handle to mcChild (contained inside mcParent)
I find that once mcParent is given an event, the child event handler can no longer work, even though the event is different.
Am I missing something here, or is this just plain not possible?
Child To Parent Movie Clip Relations Difficulties
I have a Movie Clip that holds a Movie Clip (which loads a picture). However when i set the _x and _y position of the parent movie clip it would appear that the child movie clip goes off center. The code below is the creation and positioning code of the Movie clips.
ActionScript Code:
for (y = 1; y <= _global.pictures; y++){
//output.text = "box" + y; //used in testing
// Creates a number of boxes to hold each of the pictures.
_root.photoArea.duplicateMovieClip("box" + y, y);
// This loads the pictures into the movies
_root["box" + y].photoHolder.loadMovie("../PhotoGallery/fla/pic" + y + ".jpg");
// Places the boxes with pictures loaded on stage
if(y > 1 && y % 4 == 0){
setProperty("box" + y,_x, _global.xPos);
setProperty("box" + y,_y, _global.yPos);
_global.xPos = 10;
_global.yPos += _global.picHeight;
_global.numRow += 1; //adds 1 to number of rows ever time a row is added
//output.text = y % 4; //This was used for debug
}else {
setProperty("box" + y,_x, _global.xPos);
setProperty("box" + y,_y, _global.yPos);
_global.xPos += _global.picWidth;
} // end else
}//end for loop
Here is what it looks like. Is there a way to tell the child to always be at the center location of it's parent?
Changing Size Of Child Clips To Match Parent Movie Clip?
I have a program that is dynamically loading images into a nested movie clip. The Parent movie contains the two separate movies within it and images are to switch back and forth in them. I need to know how I can use action script to load these nested movies to the exact dimension of the parent movieclip.
Here is my code:
onClipEvent (load) {
StagePictures._lockroot = true;
e_mc.loadMovie(_root.PathText+_root.imageClips[0]);
}
onClipEvent (enterFrame) {
if (Key.isDown(a number)) {
if (Key.isDown(Key.something)) {
if (Key.isDown(a number)) {
_root.StagePictures.e_mc.createEmptyMovieClip("Sec ondClip" , 3);
_root.StagePictures.e_mc.SecondClip.loadMovie(_roo t.PathText+_root.imageClips[1]);
_root.ScoreBox.text = scvar+1;
_root.Command.text = _root.imageCommand[1];
_root.Response.text = "Correct!";
}
}
}
}
StagePictures is the parent clip, e_mc is a child, and SecondClip is a child within e_mc.
Both e_mc, and SecondClip are loading the dynamic images which are the paths labeled _root.PathText+_root.imageClips[0, and 1];
The size of the images need to be contained within the size of the parent clip of both called StagePictures.
How can I set the size of the two nested clips to match the parent?
Thanks,
sam
Deleting Child Movie Clips In Parent Movie Clip
ok so I when I click the bt1 I want it to make the home_text visible and remove all of the movie clips within the CreateXMLGallery function. But when I do gallery.removeMovieClip() it only deletes the gallery and none of the other movie clips that are created within the gallery. Any ideas why? here is the code.
HTML Code:
stop();
/***********Button Functions*************/
launch_mc._visible = false;
easeSpeed = 5;
slider_mc.onEnterFrame = function() {
this._x += (xMove1-this._x)/easeSpeed;
};
bt1.onRollOver = function() {
bt1.blendMode = "invert";
};
bt1.onRollOut = function() {
bt1.blendMode = "normal";
};
bt1.onPress = function() {
xMove = bt1._x;
};
bt1.onRelease = function() {
gallery.removeMovieClip();
home_txt._visible = true;
};
bt2.onRollOver = function() {
bt2.blendMode = "invert";
};
bt2.onRollOut = function() {
bt2.blendMode = "normal";
};
bt2.onPress = function() {
xMove = bt2._x;
};
bt2.onRelease = function() {
gallery.removeMovieClip();
home_txt._visible = false;
createXMLGallery(webXML);
};
bt3.onRollOver = function() {
bt3.blendMode = "invert";
};
bt3.onRollOut = function() {
bt3.blendMode = "normal";
};
bt3.onPress = function() {
xMove = bt3._x;
};
bt3.onRelease = function() {
gallery.removeMovieClip();
home_txt._visible = false;
createXMLGallery(interactiveXML);
};
bt4.onRollOver = function() {
bt4.blendMode = "invert";
};
bt4.onRollOut = function() {
bt4.blendMode = "normal";
};
bt4.onPress = function() {
xMove = bt4._x;
};
bt4.onRelease = function() {
gallery.removeMovieClip();
home_txt._visible = false;
createXMLGallery(avXML);
};
bt5.onRollOver = function() {
bt5.blendMode = "invert";
};
bt5.onRollOut = function() {
bt5.blendMode = "normal";
};
bt5.onPress = function() {
xMove = bt5._x;
};
bt5.onRelease = function() {
gallery.removeMovieClip();
home_txt._visible = false;
createXMLGallery(designXML);
};
/**********End Button Functions**********/
/**********Load XML files**********/
var webXML:XML = new XML();
webXML.ignoreWhite = true;
webXML.onLoad = function(success) {
if (success) {
//trace("web XML File Loaded");
}
};
webXML.load("web.xml");
var interactiveXML:XML = new XML();
interactiveXML.ignoreWhite = true;
interactiveXML.onLoad = function(success) {
if (success) {
//trace("interactive XML File Loaded");
}
};
interactiveXML.load("interactive.xml");
var avXML:XML = new XML();
avXML.ignoreWhite = true;
avXML.onLoad = function(success) {
if (success) {
//trace("audio video XML File Loaded");
}
};
avXML.load("audiovideo.xml");
var designXML:XML = new XML();
designXML.ignoreWhite = true;
designXML.onLoad = function(success) {
if (success) {
//trace("audio video XML File Loaded");
}
};
designXML.load("design.xml");
/**********XML files loaded**********/
/**********Create the Gallery*******/
function createXMLGallery(whichXML) {
var gallery:MovieClip = createEmptyMovieClip("gallery", getNextHighestDepth());
gallery._x = 70;
gallery._y = 170;
var numImages = whichXML.firstChild.childNodes.length;
var spacing:Number = 60;
var columns:Number = 3;
for (var i:Number = 0; i<numImages; i++) {
this.proj_name = whichXML.firstChild.childNodes[i].firstChild.firstChild.nodeValue;
this.proj_type = whichXML.firstChild.childNodes[i].firstChild.nextSibling.firstChild.nodeValue;
this.thumbHolder = whichXML.firstChild.childNodes[i].firstChild.nextSibling.nextSibling.firstChild.nodeValue;
this.picHolder = whichXML.firstChild.childNodes[i].firstChild.nextSibling.nextSibling.nextSibling.firstChild.nodeValue;
this.proj_media = whichXML.firstChild.childNodes[i].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.nodeValue;
this.description = whichXML.firstChild.childNodes[i].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.nodeValue;
this.proj_link = whichXML.firstChild.childNodes[i].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.nodeValue;
this.thumbViewer = gallery.createEmptyMovieClip("thumb"+i, i);
this.thumbViewer._x = (i%columns)*spacing;
this.thumbViewer._y = Math.floor(i/columns)*spacing;
this.thumbLoader = this.thumbViewer.createEmptyMovieClip("thumbnail_image", getNextHighestDepth());
this.thumbViewer.description = this.description;
this.thumbViewer.picHolder = this.picHolder;
this.thumbViewer.proj_link = this.proj_link;
this.thumbViewer.proj_name = this.proj_name;
this.thumbViewer.proj_type = this.proj_type;
this.thumbViewer.proj_media = this.proj_media;
this.thumbViewer.whichXML = whichXML;
this.thumbLoader.loadMovie(this.thumbHolder);
this.thumbViewer.onRollOver = function() {
var proj_name = this.proj_name;
captionFN(true, proj_name, this);
this.onRollOut = function() {
captionFN(false);
};
};
this.thumbViewer.onRelease = function() {
launch_mc._visible = true;
var url = this.proj_link;
var type = this.proj_type;
var media = this.proj_media;
launch_mc.onRelease = function() {
if (type == "Website") {
getURL(url);
} else if (type == "Interactive") {
trace(url);
fscommand("exec", url);
} else if (type == "Design") {
var shade:MovieClip = createEmptyMovieClip("shade", getNextHighestDepth());
with (shade) {
beginFill(0xFFFFFF, 75);
moveTo(0, 0);
lineTo(Stage.width, 0);
lineTo(Stage.width, Stage.height);
lineTo(0, Stage.height);
lineTo(0, 0);
}
shade.useHandCursor = false;
shade.onRelease = function() {
trace("OUCH");
};
shade.onPress = function() {
trace("OUCH");
};
var imageViewer:MovieClip = attachMovie("imageviewer", "imageView", getNextHighestDepth());
imageView._x = Stage.width/2-imageViewer._width/2-10;
imageView._y = Stage.height/2-imageViewer._height/2;
var closeMovie:MovieClip = attachMovie("close", "closeMov", getNextHighestDepth());
closeMovie._x = 568;
closeMovie._y = 75;
closeMovie._width = 48;
closeMovie._height = 19;
closeMovie.onRollOver = function() {
this._alpha = 50;
};
closeMovie.onRollOut = function() {
this._alpha = 100;
};
closeMovie.onRelease = function() {
imageView.removeMovieClip();
closeMovie.removeMovieClip();
shade.removeMovieClip();
thumb.removeMovieClip();
};
var thumb:MovieClip = createEmptyMovieClip("thumb", getNextHighestDepth());
thumb.attachMovie(url, "urlofmovie", getNextHighestDepth());
thumb._x = Stage.width/2-thumb._width/2-10;
thumb._y = Stage.height/2-thumb._height/2;
} else if (type == "Video") {
fscommand("exec", url);
}
};
var thumbInfo:MovieClip = createEmptyMovieClip("thumbinfo", getNextHighestDepth());
//Description field attributes
createTextField("desc", getNextHighestDepth(), 555, 170, 200, 300);
desc.border = false;
desc.multiline = true;
desc.wordWrap = true;
var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "Verdana";
my_fmt.size = 12;
my_fmt.align = "justify";
desc.text = this.description+"
Media: "+media;
desc.selectable = false;
desc.textColor = 0xffffff;
desc.setTextFormat(my_fmt);
//End description field attributes
thumbInfo.loadMovie(this.picHolder);
thumbInfo._x = 315;
thumbInfo._y = 200;
};
}
}
/**************End Gallery*******************/
Load Movie Clip -> Update Child Clip
Ok, I'm not sure if this is possible, but I assume it is. So I load a movie clip in , we'll tall it "parent_clip" and it's getting loaded into a clip with the same name, so _root.parent_clip. In the loaded parent_clip there is a movie clip called "child_clip". Once it is loaded the child_clip is obviously still there, but it is no longer named child_clip. How do I access it?
Or am I just missing something all together. Thanks for the help.
(AS 2.0) Making A Clip/button Close Parent Clip?
Hi, this is probably a silly question, but I'm still fumbling around and learning, and now my employers expect me to be a genius with Flash!
Can we make something, ie a close button, that onRelease will close the parent Movieclip, regardless of the name of that parent? I'm going to need a lot of close buttons, and I don't like the idea of coding each to close the relevant MC. I've done a bit of experimenting, but not had any luck yet.
And if this works in AS3, I'm happy to know that too. Gonna get upgraded soon!
Thanks for any help,
Leia Graf
Variables Of A Child Not Visible To A Function In The Child Called From Its Parent ?
sorry, this is a repeat thread, but couldn't change the title on the old one, someone must know the solution to this problem, I just dont think i worded it correctly enough for someone who knew what i was talking about to notice last time.
Ive got a movieclip that creates and adds a child mc then calls a function in the new mc. the function runs, but the local vars for the new mc aren't visible to the function. Is there a special way to call a function so that its scope is in the child, not in the parent ? ( i assume thats where it is, even though a trace of this returns the correct object type )
ie:
[Parent Clip]
--[child clip: movGraph]
--variable ( var thegraph:MovieClip = this; )
--[function loadMe]
--(trace (theGraph); )
calling movGraph.loadMe spits out undefined or null object error, as opposed to
[object movGraph]
obviously i want to do a whole lot more than trace out the object type, and trace(this) in the function returns [object movGraph]. the variable "theGraph" declared in the child isn't available or its null somehow.
Can anyone tell me where I'm going wrong ? - any help would be appreciated. at the moment I'm having to add all the code in the function instead of the "root" of the child. which really defeats the point.
Movie Clip Colors
i've managed to create a clip that works as a paintbrush, and a couple buttons that can change the colour of that paintbrush on click. but HOW do i now take that same colour and click on say a square movie clip and make it become that selected colour.
Child Swf Load New Child Swf Inot Parent Swf
ok you're all going to think i'm super dense
but i'm also super stressed and fast approaching a deadline
can someone please tell me the simplest way to load a child swf into a parent swf from another child swf
eg. what code do i apply to the button?
i am loading into a container.mc (blank) in the parent swf
Child Swf Load New Child Swf Inot Parent Swf
ok you're all going to think i'm super dense
but i'm also super stressed and fast approaching a deadline
can someone please tell me the simplest way to load a child swf into a parent swf from another child swf
eg. what code do i apply to the button?
i am loading into a container.mc (blank) in the parent swf
Changing Movie Clip Colors
this is giving me a headache. i can't seem to get the setTransform property to work. this is what i'm doing:
frame 1
anum = 50
frame 2
object.setTransform({ra:anum,ga:0,ba:0,rb:0,gb:0,b b:0,aa:100,ab:0});
frame 3
anum = anum+5
gotoAndPlay(2);
where object is the instance name of my clip on the root timeline.
and nothing happens. any tips for using setTransform??
Changing Movie Clip Colors
this is giving me a headache. i can't seem to get the setTransform property to work. this is what i'm doing:
frame 1
anum = 50
frame 2
object.setTransform({ra:anum,ga:0,ba:0,rb:0,gb:0,b b:0,aa:100,ab:0});
frame 3
anum = anum+5
gotoAndPlay(2);
where object is the instance name of my clip on the root timeline.
and nothing happens. any tips for using setTransform??
Cycle Colors On Movie Clip
What i'm trying to do is make a movie clip box change colors with each consecutive click. I only need 3 colors...green, yellow, red. Basically, it's a couple different status boxes, and each click on that box will change the color, then repeat itself (go back to green).
Any help is appreciated!
Thanks
Movie Clip Overlap Colors
I am making a movie using AS for an intro flash movie. The movie includes rectangles that simply move downwards with random speed, height, and width.
My question is how I could change the color or alpha of the overlapping areas as seen in the quick sample I made and attached.
I have gotten some success from making the MC's with an alpha and when they overlap there is a more solid color but it isn't quite the effect I was looking for.
Movie Clip Overlap Colors
I am making a movie using AS for an intro flash movie. The movie includes rectangles that simply move downwards with random speed, height, and width.
My question is how I could change the color or alpha of the overlapping areas as seen in the quick sample I made and attached.
I have gotten some success from making the MC's with an alpha and when they overlap there is a more solid color but it isn't quite the effect I was looking for.
Moving A Movie Clip From A Parent Movie Clip
Fellas..
I've played with Flash 5 and action script a few years back.. just getting back into it recently. This might be a noob question, but I'm having a hard time trying to search for a solution.
I'm putting together a silly little game (Flash 8) that involves a tank, or missile base (ala Space Invaders) with a rotating turret. The tank consists of 2 movie clips.. one for the base/treads which attaches the mBarrel movie clip to itself.
This is a hard one to describe, so please bear with me.
I've managed to have the turret 'look-at' the mouse cursor, so it's angle adjusts to aim at where the player has the mouse reticle.
I'm firing a missile, by using some thing this..
Code:
function FireRocket():Void {
// firing a missile with attachMovie
_level0.mPlayer1.mBarrel.attachMovie("mMissile_Normal",
"mMissile_Normal" + _global.nRocket,
_level0.mPlayer1.mBarrel.getNextHighestDepth(),
{_x:(_root.mPlayer1.mBarrel._x), _y:(_root.mPlayer1.mBarrel._y)});
}
My missile has a script that simply += it's _y.
THis works beautifully. A missile appears *right* inside mBarrel, and adopts it rotation, and by having the missile MC increase/decrease it's _y will send it in motion. I was originally planning on having to use matrices to have the fired missiles inherit the barrel's angle, but having the barrel movie clip call the missile movie clip worked amazingly well.
The thing is.. if I rotate the barrel (by moving the mouse cursor) ALL the rockets automatically change their angle along with the barrel.. as to be guided missiles per se.
How do I stop the missiles from moving along with their parent MC?
wheeew..
Ref To Movie Clip In Parent Movie Clip Class
Utimately, this is for use in Flex, but I have a Movie Clip in Flash that I want to add multiple Movie Clips to. I would like listeners on each Movie Clip (or know when a particular Movie Clip is clicked). When exported to Flex, and one of the Movie Clips is clicked, it does something.
I have created a AS3 Class in Flash for my parent/base Movie Clip and I can add a event listener (for mouse down) to it. When I export to Flex it works fine.
My problem is, I need help with exposing/add listeners to the child movie clips in the parent/base Movie Clip so when the children are clicked in Flex, it will do something.
Can someone point me to a white paper or offer any advice?
Thanks in advance. J.
Need Controller Clip To Parse .txt Info For Colors
I need help. I'm trying to build a data driven map of Los Angeles in Flash. I'm not great in actionscript, so I'm hoping someone can edit the actionscript in the controller clip for me so that the color instructions from a text file can take effect!
Here's a link to a page where my raw files can be downloaded: http://www.geocities.com/flashhelp4me/
Any direction would be much appreciated. If anyone manages to make it work in the files I have made available for download, I will be very happy. My email is seth.magee@adlink.com. or sethix@hotmail.com.
Every piece of the map (including the key) is a separate loaded movie. I need the main movie (ZoneManager.swf) to read data from an external text file for the color and placement of each of the swf's that are loaded in. So far the movie does recognize a text file, and successfully places all of the pieces of L.A. The problem is, I don't know how to make the text file specify the hexidecimal color that should be assigned to each map piece. So far the colors are assigned randomly by the flash movie, which isn't what I want.
Thanks so much for any help I can get.
Changing Colors Of A Movie Clip Dynamically
I have a client that wants to change the color of a movie clip in my flash application from a user-entry update system.
Basically he is going to type "green" to the outside entry form and the movie clip's color in my flash movie will change to "green". and so on.
I am using coldfusion for backend, but this must be very simple i can even use php if you have a solution. Any help would be appreciated.
How To Target Child Clip Using This[]
I know how to target a clip directly using
ActionScript Code:
this["menuClip_Dr" + i]._y
But what about targeting a child clip in that clip:
ActionScript Code:
trace (this["menuClip_Dr" + k + "." + "childClip_" + i]._y);
The above reference to childClip is not working.
UnloadMovie From Child Clip
Hi,
I have a .swf that is loaded into a another .swf mc.
Can i close the child clip from inside itself.
Or do i have to close it from the parent swf?
Assigning Random Colors To A Movie Clip On Load
i have a movie clip that consists of a circle, i want when the movie clip loads that it will have a random color assigned to it. here is some code i have found relating to random colors, i am not sure on how to use it.
Code:
var color:Number = Math.random() * 0xFFFFFF;
If any one could give me an answer or comment that would be awasome
eric
Name Of Parent Movie Clip
I'm using dynamicly named movie clips and inside these movie cliips are buttons. The button when pressed, opens a link that is a variable on the movie clip. When I debug the link variable used simply as
trace(link)
doesn't work. I'm wondering if i have to define the movie when I reference the variable "link" and how I could do something like parent.link where parent is the name of the movieclip. Thanks
Nate
How To Determining The Name Of Parent Clip?
I've got a number of dynamically generated movie clips that then load external SWF files. I'd like to be able to figure out the name of the containing movieclip instance from inside the loaded SWF but am not sure how to go about doing that.
Any help is greatly appreciated.
Getting The Position Of The Parent Clip (this)
So I've created a movieClip. Inside the timeline of the movieClip I am trying to get the y position of the clip I am in - I can't figure out the syntax. I've tried:
_parent._y
this._y
parentClip._y
Could someone please help me get the syntax right on this?
How Do You Grab The Parent Clip's Name
I am creating a set of 20 variables using a for loop and some xml, and then i have a bunch of container files, named similarly to the loop variables that load .swfs with the variable's value for its name. I want to write a script that loads the appropriate clip into itself based on the value of the variable that goes with it.
for loop created variables like:
desktop0_name = davinci
desktop1_name = leo
desktop2_name = monet
etc...
movie clips with these names will have some script inside that will need to load a movie based on what its name is, so that I can make the clip named desktop0 load davinci.swf and the clip named desktop_1 load leo.swf, without creating 20 different nearly identical static clips. I would like to be able to test the clips name from inside so that the desktop0 clip will say "oh, i'm supposed to load davinci", and do so.
Does this make sense and does anyone know a simple way of doing this? Thanks!
Urgent Help Cant StartDrag In Child Clip
Okay> I have a movie, that loads another movie. the movie that is loaded has some drag commands that target within the same movie (not in the parent). How come this movie works when its on its own... but not at all when its loaded into the parent? help!
this is for my project due tomorrow. lol.
here is the code inside the movie that was loaded (attached to a button inside a movieclip)
here is the site im working on (if it helps) this is for the portfolio page which is loaded into the movie.
http://www.reactiongrafix.com/zen
as i say.. it works fine on its own. (like here)
http://www.reactiongrafix.com/zen/portfolio.swf
i get a pointer when i mouseover them.. but.. cant drag
Code:
on(press){
startDrag ("/dragHarry", true); //start da dragging
}
on(release){
stopDrag (); //stop da draging already!
if (this.hitTest(_root.target)) {
_root.drop_mc.gotoAndPlay("start");//play the clip
this._x = 57 ; // put it back
this._y = 145 ;
_root.gotoAndStop("harryPothead"); //lets play the target on the root timeline
}else{
this._x = 57; //put it back
this._y = 145;
}
}
-=-=-=-=-=-=-=-=-=-=-=-
Jon Thorpe
The ActionScript Newbie}
nicr0s@hotmail.com
Accessing A Child Movie Clip
This code doesn't work. The movie clip instance "start" is nested in a movie clip called "bridal_navigation".
_root.start.onRollOver=function(){
black=new Color;
black.setRGB(0x000000);
}
_root.start.onRollOut=function(){
teal=new Color;
teal.setRGB(Ox33CCCC);
}
Targeting A Child Movie Clip
Hi,
i have a parent_mc and a child_mc within parent_mc.
Now the parent_mc has 10 frames and the child_mc appears only on frame 10 of parent_mc. Also there is a stop action on this frame.
The MAINTIMELINE has an actions layer and parent_mc on stage.
Now when i try to target child_mc from the maintimeline using ...
Code:
parent_mc.child_mc.onRelease=function(){
trace("hello");
}
it does NOT work. I have seen that it only works if i make child_mc appear on the FIRST frame of parent_mc and carry on to the 10th, not if its only on the 10th frame...
does any why know why this is so?
cheers
For Each Child In XML - Create Movie Clip
i am currently working on my portfolio, and one of the main things i want to do is load my images and swfs from xml.
at the minute i am just trying to load the right number of containers for the number of files in the xml.
i understand the logic of what needs to happen, but am unsure of a few coding snippets.
i think once i load in my xml file it will be something like
for each var item in xmlData.image //image being the xml element
{
clip = new movieclip()
}
i'm not sure if there needs to be a counter so it goes throgh and counts and then displays them, at the moment i just want to work on that, and maybe get a gap between each one so i can see them loading in.
i'm going to keep looking at it but if anybody can help me out with an example or sample code that would be great
thanks
Dan
Getting ALL Child Names From A Movie Clip?
I have about 200 movie clips within a parent container that I would like store in an array -- without having to type out all 200 instance names into the array build. Is there a function that would allow me to extract and store all child names so I can just use that variable to build the array?
Thanks!!
Loading .swf Into Child Movie Clip
Trying to get an exteranal .swf to load into the child clip of a Mc that slides an _x axis.
1. I am going from root time line to a clip called rooms.
2. In the rooms MC there are 5 Mcs horizantally aligned on different layers.
3. I experimented with the idea that I could create a blank Mc and load and exteral .swf into it's eaxct location within the Rooms MC.
4. I am using the following in my 1 st frame: loadMovieNum("kitchen.swf","load");
5. of coarse This is loading the external kitchen.swf into the child clip instance named load right?
help.
Thanks in advance
Targeting A Child Movie Clip:
I have a movie clip on the main timeline calledbg_graphics, I want to target a movie clip within that movieclip called bg1_mc. to gotoAndPlay frame 2.
if anyone can help me out with this code that would be great, but wait theres more.
The bg_graphics clip goes to a random frame within that movieclip, there are 3 frames. 1st has bg1_mc, 2nd has bg2_mc, and 3rd has bg3_mc. How could i determine which file to gotoAndPlay frame 2 in bg_graphics when i don't know exactly which frame its going to be on, let alone target a movie clip within a movie clip.
I used this code to generate the random frame if that is of any use to anyone who is willing to reply.
function randomBg() {
//generate random BG based on random frames within the MC
randFrame = random(3)+1;
bg_graphics.gotoAndStop(randFrame);
}
Can anyone help??? that would be great.
Targeting A Child Movie Clip:
I have a movie clip on the main timeline calledbg_graphics, I want to target a movie clip within that movieclip called bg1_mc. to gotoAndPlay frame 2.
if anyone can help me out with this code that would be great, but wait theres more.
The bg_graphics clip goes to a random frame within that movieclip, there are 3 frames. 1st has bg1_mc, 2nd has bg2_mc, and 3rd has bg3_mc. How could i determine which file to gotoAndPlay frame 2 in bg_graphics when i don't know exactly which frame its going to be on, let alone target a movie clip within a movie clip.
I used this code to generate the random frame if that is of any use to anyone who is willing to reply.
function randomBg() {
//generate random BG based on random frames within the MC
randFrame = random(3)+1;
bg_graphics.gotoAndStop(randFrame);
}
Can anyone help??? that would be great.
Setting Property In A Child Clip
via "Attachmovie"
my script has created these 3 levels ClipA.ClipB.ClipC
Clip C has a dynamic text box
When the movie loads...
ClipA creates multiple ClipB's and then assignes each with a different color
myColor = new Color(boxname); //boxname = new instance name
myColor.setRGB(0xAB12B8);
When the mouse hovers over a ClipB it attaches a ClipC which automatically becomes the same color as it's parent, which is good, except the Text in ClipC becomes the same color and therefore invisible.
I've tried using multiple methods, and MANY different places to drop the scipt in order to change text in ClipC
It seems once a new color has been invoked in ClipB, ClipC not only takes it but it can no longer be separated.???
By the by If I do not change the color of ClipB in the script, I can change ClipC;s colors
Is it a lost cause? Need I do this manually?
thx in advance
Ghandigu
AttachMovie() Child Clip Targeting
Thanks for taking the time to read this. Here's my problem: I have a clip, to which I am using attachMovie to attach other clips to the end of it, making one really long strip... no problem with that. Inside each of the clips are other movie clips that are named. I want to be able to get the _x values of the clips inside the clips that were attached. When I try to target them with something like this: baseMovieClip.attachedClip.MovieInsideAttached._x --- it returns a value of 0. When I attach a trace() command inside an onClipEvent(enterFrame) and trace the ._x of the clip inside the attached movie clip, it returns a value that is based on 0, and not the value of the width of the entire attachmovie then the value of _x for the clip inside. Does anyone know if it's possible to get the coordinates and properties of movieclips that reside inside attached movie clips? Any advice or suggestions are greatly appreciated.
Parent Movie Clip Referencing
How do I reference two levels above a mc?
Is is _parent._parent ?
I have a mc with a mc inside that has a mc inside. The third mc I want to talk back to the first one.
Not working for me.
Changing Parent Of A Movie Clip
Hello!
I'd like to be able to change the parent of a movie clip.
Here's the situation:
I have MCs named A, B, C, and D. They've been properly linked/exported. MC A has been manually placed on the stage.
1. A is made to be parent of B - done using attachMovie to pull it out of the library.
2. B is made to be parent of C - again using attachMovie.
Goal is to make A parent of D parent of B parent of C, without having to pull B and C from library again, and remake B as parent of C.
Usage of duplicateMovieClip would be OK, but how to change the parent of B?
Thanks,
Mike
Preloader, But With Status In Parent Clip. How?
I have a parent movie clip that has an animation which I want to play while external clips are loaded. How can I go about this?
I've tried the following.
images = blank mc which will be used to load exteral swfs.
status = movie clip animation.
so the button says this
Code:
on(release){
if(_root.images.getBytesLoaded < _root.images.getTotalBytes)
_root.status.play();
}
This doesn't work =/. Both the getBytesLoaded and getTotalBytes are always equal even in simulate download mode.
Help =)
Jesse
Parent Movie Clip Preload.....
Hello,
Is it possible to preload a movieclip (not an external swf) within the parent movie independently from the rest of the movie.
LoadMovie Clip Talking To Parent
Hi Everyone. My first post here, and its a question...
I am wondering if I can get a .swf loaded in using the 'loadMovie' method to talk to the timeline of the original .swf.
And if so, how would I do this?
I am using a preloader on the clip that is loaded in and when that clip is loaded I want to call a function on the original clip.
I consider myself pretty fluent in Actionscript so no need to hold back...
Any help much appreciated!
EDIT:
Now that I think about it...
I just want a preloader to display while the clip is loading, so the user knows what is going on, would it be better to place the preloader on the orginal clip. If so, how do I get the bytesLoaded, bytesTotal, etc info about the .swf i want to load in?
Hope that makes enough sense...
- Elliot Owen
Resizing Parent Movie Clip
Can I resize the parent/root movie clip? Basically I have one default mode that shows a ton of information, but then I'd like to be able to switch to a compact mode.
Normal mode is currently 550x550, but i'd like compact mode to be 1000x200. So how do I go about resizing the main frame? Can I?
Thanks,
Jason
Controlling The Parent Movie Clip
hello, i am in a bit stuck on this problem
i have a function that gets a target_mc (you know with the function blaBla(target_mc){)
if i trace the target_mc, i get the child mc, meaning something like : _level0.thumbLoader_mc1.holder
now i need to play with the thumbLoader_mc1, but i dont know how to reach it.
i tried through simply using trace(_parent.target_mc), but that gave me undefined... thats where i am stuck. if anybody knows if theres a way, that would be most appreciative
thank you
|