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








Remove Clip Created With CreateEmptyMOvieClip


I was wondering is there any way to remove a mc created with CreateEmptyMOvieClip ???

Any1 know any wayaround ?




FlashKit > Flash Help > Flash ActionScript
Posted on: 03-04-2005, 04:04 AM


View Complete Forum Thread with Replies

Sponsored Links:

Remove A Clip Created With CreateEmptyMovieClip
Hi All

I'm trying to remove a created movie clip, but it's not working.
Does anyone know why this isn't working?

MovieClip.prototype.scaleUp = function (scaleAmount, scaleSpeed,callBackFunction)
{

var depth = this.nextDepth ();
this.createEmptyMovieClip ("scaler_mc", depth);
var mc = this.scaler_mc;
mc.scaleAmount = scaleAmount;
mc.scaleSpeed = scaleSpeed;
mc.onEnterFrame = function ()
{

if (this._parent._xscale < this.scaleAmount)
{
this._parent._xscale *= this.scaleSpeed;
}
else if (this._parent._xscale <> this.scaleAmount)
{
this._parent._xscale = this.scaleAmount;


this._parent[callBackFunction]();
// this bit is not working
this._parent.removeMovieClip(this)
//also like this removeMovieClip(this)
// and this this.removeMovieClip();
// and this this._parent.removeMovieClip(this._parent.scaler_mc)


}
};
};
it wont get rid of the created clip but if i try this:
this.createEmptyMovieClip ("scaler_mc", 1);
removeMovieClip(scaler_mc);

gets rid of it straight away.

Regards

Dan

View Replies !    View Related
Can't Remove Movie Created With _root.createEmptyMovieClip(}
I have a portion of code listed below that is used to create a movie clip called "Menu". It loads a movie array called itemClip. All works fine. My problem is I can't figure out how to unload the menu movie. I have tried several options, including menu.removeMovieClip(); ... to no avail. Can anyone tell me how to remove the clip from the current timeline?



Code:
var menu = _root.createEmptyMovieClip("menu_mc", 1);
menu._x = 250;
menu._y = 50;


for(var i=0; i < sectionCount; i++){
var depthCount = menu.getNextHighestDepth();
var item = menu.attachMovie("itemClip", "item_" + i, depthCount);
item.labelName = titles[i];
item.song = songs[i];
item.targetClip = this;
item._y = i*25;
Any help would be appreciated.

Thanks
Rick

View Replies !    View Related
Deleting Movie Clip Created By CreateEmptyMovieClip
how can I delete/remove/whipe-out/DESTROY a movie clip created by createEmptyMovieClip();?
I tried to use removeMovieClip...but obviously it doesn't work.

View Replies !    View Related
Remove Movie Clip Created With AttachMovie
I have a frame that is populated with movie clips that were created with the attachMovie command.

I don't want these movies on the next frame.

How do I delete them ?

I have tried clipname.removeMovieClip(); in the second frame but it isn't working.

Any ideas?

View Replies !    View Related
How Do I Remove A The Contents Of A Movie Clip Created Using LoadClip?
I have a Flash site that loads specific SWFs into a movie clip called "content_mc" based on a button click. I do this using the "loadClip" method. I then remove (I thought) the SWF from the movie clip with "unloadClip" and replace it with a new SWF using "loadClip." All seemed to be working fine, but now I see that scripts from a SWF that I thought I unloaded are still running.

I'm sure this is due to my lack of understanding of what "loadClip" and "unloadClip" are doing. And there certainly may be a better way to do what I want to do... but such is life. What is the method to delete a the contents of a movie completely from memory? or is there a better way to do what I want to do?

Thanks for your help,
David

View Replies !    View Related
Remove CreateEmptyMovieClip
Hi,
How does one delete the following? I think the getNextHighestDepth() is causing an issue.

Code:
var content_holder_mc = createEmptyMovieClip("content_holder", this.getNextHighestDepth());
Cheers

View Replies !    View Related
How Do I Close A MC Created With CreateEmptyMovieClip?
I have a series of objects each dynamically created with createEmptyMovieClip. They are contained within a parent movie clip.

Sometimes there can be many of these clips. Each is on a different level. So far, I have found no means of deleting or otherwise getting rid of them after they are no longer needed.

I have tried getting rid of the parent clip, but the child clips stay. Does anyone know how I can delete these unwanted MCs?

Thanks,

Will

View Replies !    View Related
Code On MC's Created With CreateEmptyMovieClip
Is there any way to put code on an mc created with createEmptyMovieClip?

View Replies !    View Related
OnClipEvent For Clips Created With CreateEmptyMovieClip
Is there a way of using onClipEvent(data) when I use "createEmptyMovieClip" to create a clip which will be loaded with data from an external source?

if i try the following on frame 1 (action layer):

_root.createEmptyMovieClip("TempVars", 1);
loadVariables("dbquery.php","TempVars");
_root.TempVars.onClipEvent(data){
_BabyClip._alpha=25;
}

I get the following message in Output...
Scene=main, Layer=Layer 1, Frame=1: Line 3: Expected a field name after '.' operator.
_root.TempVars.onClipEvent(data){

any ideas?
thanks

Daf

View Replies !    View Related
Destry Movie Created With 'CreateEmptyMovieClip'
I have been reading the documentation, and i cannot find a way to remove clips that are created using this method. Like the guy in the other post, i want this clip unloaded (destroyed) when ANY other link is clicked. This clip is an empty container clip that will be generating child clips that will each be loading thumbnails for images. Obviously i need to destroy the parent clip to remove all children without looping, etc.

This movie clip ("TL") is created in a keyframe that is the stopping point of an animation. When a user clicks the Portfolio link from the menu, the menu hides itself, and then goes to a frame label where actionscript awaits. Once there, the AS tells the submenu movie to animate (play). The submenu then plays and stops when it hits a certain frame (the one with the 'stop();' code, lol), and that frame then contains actionscript that generates the Gallery Thumbnails' parent container ("TL"), via:
var TL:MovieClip = createMovieClip("TL",60);

and GT then creates movie clips for thumbnails to be contained in via:
TL.createEmptyMovieClip('Thumb' + i,TL.getDepth() -1);

All this works so far. Now, to get rid of the clip when any other button is clicked, i tell the gallery movie to play again, which alphas it out of sight. So, on the NEXT frame of the timeline AFTER the frame which the TL and children are created is where i need to place the actionscript to unload/remove them. The problem is that there is no method for this! It seems that all the methods for removing / unloading clips only apply to clips that were duplicated or instatiated from loading external files or attaching instances from the library...

So that's where i'm stuck. I need to remove this "TL" clip, and can't figure out how. Any help is apreciated. The site is http://UniSys-Corp.com if it would help to see how my menus animate.

I tried switching things around a bit, to no avail. This works:

PHP Code:



    _root.mcMenuGalleryAnimation.attachMovie("thumbsList","TL",60);

    TL._x = -300;

    TL._y = 0;

    TL.width = 60;

    TL.height = 60;

    TL.loadMovie("../portfolio/misc/tn/1.jpg");




But this does not:

PHP Code:



    _root.mcMenuGalleryAnimation.attachMovie("thumbsList","TL",60);

    TL._x = -300;

    TL._y = 0;

    TL.width = 60;

    TL.height = 60;

    TL.attachMovie("thumbnail","tn",TL.getDepth() +1);

    tn.loadMovie("../portfolio/misc/tn/1.jpg");

View Replies !    View Related
When Killing A Container Created By CreateEmptyMovieClip
howdy all --
say i have a container created by createEmptyMovieClip and it contains six items created via attachMovie... If i do a container.unloadMovie(); will that unload/do away with all the movies within it as well? .. (and is removeMovieClip somehow a better option?)

Many thankS!

View Replies !    View Related
RemoveMovieClip On Object Created From CreateEmptyMovieCLip
From the flash help, it says:

Method; removes a movie clip instance created with the duplicateMovieclip action, or the duplicateMovieClip or attachMovie methods of the MovieClip object.

But i have movieClips created from createEmptyMovieClip();, so i'm assuming removeMovieClip(); won't work. Is there another way to remove this then?? thanks!

View Replies !    View Related
Resizing Movieclip Created By CreateEmptyMovieClip
i need help in resizing a movieclip created with createEmptyMovieclip.I tried changing the property using setproperty,the result : no image shown at all..
i think i stting a property for a wrong movieclip..am I??please help me...



Code:
addressVars= new LoadVars();
addressVars.load("http://localhost/test/flashmx_dbPassReturn.php");
addressVars.onLoad = function() {
for (i=0; i<this.n; i++){
myMC = createEmptyMovieClip("holder"+i, i);
myContainer = myMC.createEmptyMovieClip("container", 1);
myContainer.loadMovie(this["picFile"+i]);
setProperty("myMC", _width, "35"); //i want to change the clip size so that
setProperty("myMC", _height, "35"); //it'll appear as thumbnails
myMC._x = (40*i);
myMC._y = (1*i);
pic = new Array();
myMC.pic = (this["picFile"+i]);
myMC.i = i;
myMC.picfile = this["picFile"];
myMC.onPress = function (){
_root.screen.loadMovie(this.pic);
}
}
}

View Replies !    View Related
?onPress Event With MCs Which Were Created With CreateEmptyMovieClip?
how can I have the onPress and all the other event handlers working
with MCs wich were crated with the createEmptyMovieClip?
I allready did some reading wich says that I have to assign them to a
external class file, but so far I have no idea how to do that and what the
.AS file should contain.

View Replies !    View Related
Destry Movie Created With 'CreateEmptyMovieClip'
I have been reading the documentation, and i cannot find a way to remove clips that are created using this method. Like the guy in the other post, i want this clip unloaded (destroyed) when ANY other link is clicked. This clip is an empty container clip that will be generating child clips that will each be loading thumbnails for images. Obviously i need to destroy the parent clip to remove all children without looping, etc.

This movie clip ("TL") is created in a keyframe that is the stopping point of an animation. When a user clicks the Portfolio link from the menu, the menu hides itself, and then goes to a frame label where actionscript awaits. Once there, the AS tells the submenu movie to animate (play). The submenu then plays and stops when it hits a certain frame (the one with the 'stop();' code, lol), and that frame then contains actionscript that generates the Gallery Thumbnails' parent container ("TL"), via:
var TL:MovieClip = createMovieClip("TL",60);

and GT then creates movie clips for thumbnails to be contained in via:
TL.createEmptyMovieClip('Thumb' + i,TL.getDepth() -1);

All this works so far. Now, to get rid of the clip when any other button is clicked, i tell the gallery movie to play again, which alphas it out of sight. So, on the NEXT frame of the timeline AFTER the frame which the TL and children are created is where i need to place the actionscript to unload/remove them. The problem is that there is no method for this! It seems that all the methods for removing / unloading clips only apply to clips that were duplicated or instatiated from loading external files or attaching instances from the library...

So that's where i'm stuck. I need to remove this "TL" clip, and can't figure out how. Any help is apreciated. The site is http://UniSys-Corp.com if it would help to see how my menus animate.

I tried switching things around a bit, to no avail. This works:

Code:
_root.mcMenuGalleryAnimation.attachMovie("thumbsList","TL",60);

TL._x = -300;

TL._y = 0;

TL.width = 60;

TL.height = 60;

TL.loadMovie("../portfolio/misc/tn/1.jpg");
But this does not:

Code:
_root.mcMenuGalleryAnimation.attachMovie("thumbsList","TL",60);

TL._x = -300;

TL._y = 0;

TL.width = 60;

TL.height = 60;

TL.attachMovie("thumbnail","tn",TL.getDepth() +1);

tn.loadMovie("../portfolio/misc/tn/1.jpg");

View Replies !    View Related
RemoveMovieClip On Object Created From CreateEmptyMovieCLip
From the flash help, it says:

Method; removes a movie clip instance created with the duplicateMovieclip action, or the duplicateMovieClip or attachMovie methods of the MovieClip object.

But i have movieClips created from createEmptyMovieClip();, so i'm assuming removeMovieClip(); won't work. Is there another way to remove this then?? thanks!

View Replies !    View Related
Deleting Movieclips Created With CreateEmptyMovieClip()
in the flash documentation it says you can use 'RemoveMovieClip()' to delete movieclips created with 'duplicateMovieclip()' and 'unloadMovieclip()' to delete movieclips created with 'loadMovie()' but what about a clip created with 'createEmptyMovieClip()'?

how can I delete this clip?

in context:
I'm creating an application that requires the drawing of various polygons over the top of images...
creating a polygon creates a new empty MovieClip which is then has the polygon drawn in it.
when you finish plotting a polygon it gets assigned onPress events...(so i can select it)
now I wish to be able to select the polygon and press 'del' and it'll delete it.

sure I could just set it invisible but surely there's a way to kill a movieclip after you create it?

View Replies !    View Related
Assigning A Linkage ID To A Movieclip Created With CreateEmptyMovieClip()
Hi,

I have a movieclip I created usind createEmptyMovieClip(). How can I assign a Linkage Id to that clip?

My reason for this is I later want to attach that clip I created to another clip using attachMovie() which requires a Linkage Id.

Thanks

View Replies !    View Related
Problem With Deleting A Mc (created With CreateEmptyMovieClip) 18+ Site
Hello,

I've used the 'photodrop' gallery which you can find on braingiants.com. This is a xml-based gallery with some animation on the photo's.
I've implemented this script in my home.fla on a certain frame. On that frame, there are several movieclips created to load the thumbnails and the pictures. All this works fine.
Now here comes the clue: when I click a button to go to another frame, the thumbs and the big picture stay on the screen (although the '+' and '-' button next to the thumbs dissapears).
On every page, there is an external swf loaded into the mc 'holder'. I've tried to load the gallery.swf into 'holder', but it didn't work anymore. That's why I've pasted the script into the home.fla.

To show you the problem: click here and then on 'portfolio' on the bottom. You'll see that it works fine. When you click another button, the picture and thumbnails stay on the screen...

How can I fix this? I've been looking for 2 days now and tried all sorts of things with removeMovieClip, unloadMovieClip,.... and SwapDepths, but I can't seem to figure it out.

You can download the fla here and the xml-file is here.

All help is appreciated!

View Replies !    View Related
Adding Actions To MCs Created Using CreateEmptyMovieClip Doesn't Work - Pls Help
Hi all

I'm wondering something. I checked the help section for createEmptyMovieClip and there I found this code:


Code:
this.createEmptyMovieClip("logo_mc", this.getNextHighestDepth());
logo_mc.loadMovie("http://www.macromedia.com/images/shared/product_boxes/80x92/studio_flashpro.jpg");



If I just paste this in a new document it works fine. But I want to add a onRelease action to this new MC, but that doesn't work, so my question is:
Is it even possible to add actions to MCs created with createEmptyMovieClip?

Here's the code I tried:


Code:
this.createEmptyMovieClip("logo_mc", this.getNextHighestDepth());
logo_mc.loadMovie("http://www.macromedia.com/images/shared/product_boxes/80x92/studio_flashpro.jpg");

logo_mc.onRelease = function() {
getURL("http://www.flashkit.com", "_blank");
}

View Replies !    View Related
[MX] Dynamically Naming Clips Created With _root.createEmptyMovieClip()
Hi

Simple question – how can you name clips “dynamically” when using using _root.createEmptyMovieClip() ?

I have an incrementing variable “r” that I am using in the following scenarios, but nothing gives?

_root.createEmptyMovieClip("curveline"+ r, (1000+r));

_root.createEmptyMovieClip(this[curveline”+ r], (1000+r));

_root.createEmptyMovieClip(_root[curveline”+ r], (1000+r));

The code works fine with just "curveline"in the parameter field, but as soon as I append “r” to it, to eanble me to address it later, the function fails?

View Replies !    View Related
Flash MX Actionscript (targeting Movieclips Created Useing Createemptymovieclip()
Hey all


I am having a tough time figuring out this code that I am writing and am wondering if anyone can lend a helping hand.

I am making a flash movie for my webpage that displays my photographs taking.

www.cpasols.com/photos2.htm

The movie loads the jpg files in dynamically with the createEmptyMovieClip() in a movieclip named imageHolder

I then load imageHolder into the scrollBar component.

From the scroll bar component I can scroll the movieclip imageHolder.

I run a trace on the jpg so that When i press the jpg that is loaded in imageHolder, the path name of the jpg comes up.

The issue that I am having is that when I press any image, the path name comes up as imageHolder instead of imageHolder.jpg5(or jpg 6, really depending on what jpg the image is)

Everything works as it should except targeting the jpg images.

Here is all of the code that I have written so far( there are 3 movie clips in this movie)

code in Frame 1 on the Root of movie

for (i=0; i<7; i++) {
name = "jpg"+i;
_root.imageHolder.createEmptyMovieClip(name,i);
trace(_root.imageHolder[name] );
mc = _root.imageHolder[name];
mc._xscale = 30;
mc._yscale = 30;
mc._x = 0;
mc._y = (130*i);
trace(_root.imageHolder[name]._name);
//Change the blue to absolute web address of your images
mc.loadMovie(("C:\Business\Carlos Site\photopage\images\")+[name]+".jpg",_root.imageHolder, i);
}





code in MovieClip 1(imageHolder)
on (rollOver)
{
_root.bigImageHodler.loadMovie(("C:\Business\Car los Site\photopage\images\")+[_root.name]+".jpg", i +1);
trace(_root.imageHolder + "."+ _root.name);

//trace(_root.imageHolder[name]._name);
//loadMovie(("C:\Business\Carlos Site\photopage\images\")+[name]+".jpg", 0);
//trace(_root.imageHolder._name+_root.name);



}


code in scroll bar component (scrollBox)

onClipEvent (enterFrame) {
_root.scrollBox.setScrollContent(_root.imageHolder );
}



there is no code in the last movieclip (bigImageHolder)

I have ran the debugger on this code and it creates the movie clips and i can see the jpgs, i just cant target them.



Thanks for any help at all.
I know the paths are how they are on my local pc.
I have attacfed the fla file that I am working on also

View Replies !    View Related
Problem Of Remove The Created Mc
i donnt know how can i remove the create mc what depth is "-1"
_root.createEmptyMovieClip("mc",-1);

i used mc.removeMovieClip() as usual,but cannt

View Replies !    View Related
Save A Dynamically Created Mc Before Remove
Hi
I have some code that creates an empty movie clip, and then dynamically fills that clip with smaller circle clips at random x and y positions.

The circles are pre-drawn mc’s that have an invisible btn to make them gotoAndStop(). Also the btn removes the empty_mc from the stage.

Problem: I want to be able to recall the empty_mc but not re-seed all the circles at random again.
So I need to save the mc before removing if possible? Else I was thinking I’d have to save each circles’ _x and _y and replace each one on the stage again.

Any thoughts/help would be great!

Thanks
Tom

View Replies !    View Related
Remove A Created Sound Object
Hello to everyone. I'm pretty new here so i think it is a good thing say HELLO to this new community i just joined..

After this... well... my problem is this...
I create a sound object in the first and only frame of my movie:

mysound = new Sound(mySound);
mySound.attachSound("beat");
mySound.start(0, 9999999);

ok.. it works fine...

Well... i load an external movie with its own audio so i need, through the same button i load the external swf, to stop the audio i created b4... but.. HOW TO DO???

Well.. it should be good set the volume of the created sound object to 0 too...

Thanx!!!!!!

View Replies !    View Related
Help Remove ALL Dynamic Buttons Created By A Function
I'm sorry if this is a duplicate post. I can't find evidence of my first attempt anywhere.
Please see attached file(s) for reference...
I created a function to attach, name, and position a dynamic button movie clip. I ran the function 5 times to create buttons "choice1", "choice2", etc.
In the next frame, I want to remove all 5 buttons using 5 removeMovieClip commands, but only "choice2" thru "choice5" go away.
My grasp of functions is still fairly fragile. Can you help me figure out what I am missing?

View Replies !    View Related
Remove Movie Clip Help, Remove Child {AS2}
So, I'm new here, and do to the lack of good help on Kongregate, I have come here =D Hopefully somebody here will be able to help me

if(_root.row2.block1._x == _root.row1.block1._x)
{
_root.row2.block1.removeMovieClip();
trace("working");
}


now, the trace fires, and, if I remove ".block1" the entire movie clip is removed, but with it in there, to remove the MC from within my MC, it WONT be removed, am I doing this wrong or am I making some other error?

View Replies !    View Related
[F8] Remove Dynamically Created Movis Clips From Stage
i am needed some help with this one.

i have dynamically created movie clips through action script to make a small image viewer for a site that i am working on. the problem that i am having is, if a user goes to one of the image viewers and looks at the images there then moves onto the next page with images the movie clips are replaced by the new ones. if the user then goes to a page with no images viewer on it i am left with a black box on the screen where the thumbnails were held for the image viewer.

i have used this code to remove the movie clips but it does not seem to be working.


Code:
removeMovieClip(this.container_mc);
any help on this would be great.

View Replies !    View Related
How Do I Remove Dynamically Created Movie Clips From The Stage Using Code
Hi,

I have some code that generates thumbnails based on a variable called maxThumbnail. The problem I am having is that once the thumbnails are created, i cannot remove them so the code can run again to create a new set of thumnails in the same place.

Heres the code

for (var i = 1; i <= maxThumbnail; i++)
{
newThumbnail = this.attachMovie ("thumbnail", "thumb" + i, i);
}

My current solution is to add an empty keyframe after the frame where the holding movie clip is. I then just play the timeline to remove and reload the holding movie clip. Is there a way of doing this dynamically. I would imagine it would be something along the lines of

removeMovieClip(_root.thumbailholder)
loadMovieClip(_root.thumbailholder)

View Replies !    View Related
Can A Created "createEmptyMovieClip" Movieclip Have A RollOver State?
.... because I can't get it to work!

Code:
var thumbBalcony:MovieClip = this.createEmptyMovieClip("thumbBalcony",this.getNextHighestDepth()+3);
thumbBalcony.loadMovie("flash-balcony-small.png");

thumbBalcony.onRollOver = function():Void {
thumbNoteOut("thumbBalconyText");
}
Is this supposed to be like this? Orrr am I missing something?

View Replies !    View Related
Masking A Movieclip Created Using "CreateEmptyMovieClip"
I want to load .jpg files and as I want to trap .jpg files height and width I have used "CreateEmptyMovieClip" option. But the problem begin when I tried to mask the jpg image.

Please let me know how can I mask it.

Here is the code that I am using
===============================

this.createEmptyMovieClip("holderMC",1);
holderMC._x = 100;
holderMC._y = 100;
holderMC.loadMovie("http://www.xponsedev.com/mockups/landnodown/mock1.jpg");
this.onEnterFrame = function() {
percent = (holderMC.getBytesLoaded()/holderMC.getBytesTotal())*100;
if (percent == 100) {
a = holderMC._height;
delete this.onEnterFrame;
}
};

View Replies !    View Related
Clip Duplicated From CreateEmptyMovieClip
Hi,
do movieClips that are duplicated from a clip created with createEmptyMovieClip inherit its handlers

say i do this:


PHP Code:



this.createEmptyMovieClip('box', 1);
this.box.beginFill(0xFFFFFF, 0);
this.box.lineStyle(0.15, 0x000000, 100);
this.box.lineTo(0, 76);
this.box.lineTo(76, 76);
this.box.lineTo(76, 0);
this.box.lineTo(0, 0);
this.box.endFill();

this.box.onMouseDown = function(){
    trace(this._name);
}

for (var i = 0; i<5; i++) {
duplicateMovieClip(this.box, "box"i, _root.getNextHighestDepth());
}




because when i do this,and click on the duplicated clip, instead of getting its name, i get the name of the original.
Thanks for any help

View Replies !    View Related
Moving A Clip Made From CreateEmptyMovieClip
I can't seem to move a clip I created with the createEmptyMovieClip() function. the trace shows the _x and _y changing but nothing on the screen moves an inch. I have tried searching and found some threads but nothing that helped stuff about making sure the _root and what not was specified correctly. If you have some time test my code (will run in just a new fla)
I'll be your friend if you help TIA


ActionScript Code:
//draw a dashed line function dashed_line(width, xy, size, spacing, weight, color, alpha) {      //defaults     width     = width     ? width     : 500;     xy         = xy         ? xy         : 'x';     size     = size         ? size         : 5;     spacing = spacing     ? spacing     : 5;     weight     = weight     ? weight     : 1;     color     = color     ? color     : 0x51524E;     alpha    = alpha        ? alpha        : 100;          count = 0;          //start line     lineStyle(weight, color, alpha);          while (count < width)      {             //determin weather to draw the line on the x or y axis         if (xy == 'x')         {             x_move = count;             y_move = 0;                          x_draw = count+size;             y_draw = 0;         }else{             x_move = 0;             y_move = count;                          x_draw = 0;             y_draw = count+size;         }                  //move the pen         moveTo(x_move, y_move);         lineTo(x_draw, y_draw);                  //increase count         count = count+size+spacing;     } }  //create a horozontal dashed line createEmptyMovieClip('hline_mc', 0);  with (hline_mc) {     dashed_line(200,'x',5,1,.1,0x51524E,50); }  //create a virtical dashed line createEmptyMovieClip('vline_mc', 1);  with (vline_mc) {     dashed_line(200,'y',5,1,.1,0x51524E,50); }  hline_mc.onEnterFrame = function () {     hline_mc._y = _root._ymouse;     trace('hline_mc._y = '+hline_mc._y); }  vline_mc.onEnterFrame = function () {     vline_mc._x = _root._xmouse;     trace('vline_mc._x = '+vline_mc._x); }

View Replies !    View Related
Moving A Clip Made From CreateEmptyMovieClip
I can't seem to move a clip I created with the createEmptyMovieClip() function. the trace shows the _x and _y changing but nothing on the screen moves an inch. I have tried searching and found some threads but nothing that helped stuff about making sure the _root and what not was specified correctly. If you have some time test my code (will run in just a new fla)
I'll be your friend if you help TIA


ActionScript Code:
//draw a dashed line function dashed_line(width, xy, size, spacing, weight, color, alpha) {      //defaults     width     = width     ? width     : 500;     xy         = xy         ? xy         : 'x';     size     = size         ? size         : 5;     spacing = spacing     ? spacing     : 5;     weight     = weight     ? weight     : 1;     color     = color     ? color     : 0x51524E;     alpha    = alpha        ? alpha        : 100;          count = 0;          //start line     lineStyle(weight, color, alpha);          while (count < width)      {             //determin weather to draw the line on the x or y axis         if (xy == 'x')         {             x_move = count;             y_move = 0;                          x_draw = count+size;             y_draw = 0;         }else{             x_move = 0;             y_move = count;                          x_draw = 0;             y_draw = count+size;         }                  //move the pen         moveTo(x_move, y_move);         lineTo(x_draw, y_draw);                  //increase count         count = count+size+spacing;     } }  //create a horozontal dashed line createEmptyMovieClip('hline_mc', 0);  with (hline_mc) {     dashed_line(200,'x',5,1,.1,0x51524E,50); }  //create a virtical dashed line createEmptyMovieClip('vline_mc', 1);  with (vline_mc) {     dashed_line(200,'y',5,1,.1,0x51524E,50); }  hline_mc.onEnterFrame = function () {     hline_mc._y = _root._ymouse;     trace('hline_mc._y = '+hline_mc._y); }  vline_mc.onEnterFrame = function () {     vline_mc._x = _root._xmouse;     trace('vline_mc._x = '+vline_mc._x); }

View Replies !    View Related
Hide/Show Clip And Remove Last Clip
Hello everybody !

just a subsidiary question regarding my animation.
it works very well : when I click on the button of each color, my clip colored a rectangle with the button color and write on it the color reference; when I click on another button (with a different color) it works perfectly, but the old result stays on the animation
my question is how to clear the results when I press the button
============
my code :

Code:
on (press) {
resultat._visible = true;
resultat1._visible = false;
var colorful = new Color("_root.resultat");
colorful.setRGB(0xCC66CC);
var colorful = new Color("_root.stickshapes");
colorful.setRGB(0xCC66CC);
var couleur1="dragée 07 fini brillant";
var couleur2="dragée 08 fini mat";
colorligne1.text=couleur1;
colorligne2.text=couleur2;
}
=============
Thanks a lot for your answer and help
Françoises from Paris

View Replies !    View Related
How Do I Put A Dynamically Created Movie Clip Into Another Dynamically Created Mc?
I want to be able to have movie clip A to be inside movie clip B, but both movie clips should be dynamically created.
How should I do that?
is there a function for putting one movie clip inside another?

View Replies !    View Related
Why Won't It Remove My Clip?
So I've tried multiple ways of writing the following code and...
I'm able to put the clip on the stage but not remove it.
What I want to happen is for the user to click a button on my Level1 screen and the hero clip on that screen to disappear when the program enters the next screen.
I have all my buttons set up and no errors but the clip I want to remove just sits there even in Level2.

package source {

import flash.display.*;
import flash.events.*;
import flash.text.*;
import fl.controls.*;
import source.*;

public class Game extends MovieClip{

//// ---- Private Variables -------------- ////

private var firstHero:Hero;
private var exitCurrentState:Function;

//// ---- General Game Functions ----------- ////

private function enterLevel1State():void{
exitCurrentState = exitLevel1State;
firstHero = new Hero();
addChild(firstHero);
firstHero.x = 68.1;
firstHero.y = 210.6;
}
private function exitLevel1State():void{
removeChild(firstHero);
trace("Child has been removed.");
}
}
}

For whatever reason the program completely ignores the last function. No freshly removed clip and no trace.

This problem should be elementary but I'm tired and AS is still fairly new to me.
Any help would be greatly appreciated.

View Replies !    View Related
Can't Remove Clip
I can't kill it!

I have a library clip with a window UI object in it. I place the attached code into the window.

Now another script attaches the said clip into the storyline. When I click the 'close' button, it says "clicked" and tells me the object I'm trying to remove does exist. But it doesn't go away.

Is it me or are windows evil?







Attach Code

on(click) {
trace("clicked");
trace(_root.view_mc);
_root.view_mc.removeMovieClip();
}

View Replies !    View Related
How To Remove A Clip
Where do I insert so that a clip instanced home would be removed upon clicking a link other than home in the main menu?


Quote:




var soundStatus = true;
var mainSound = new Sound(_root.mcMainSound);
var clickMenu = new Sound();
var _click = new Sound();
_click.attachSound("click");
clickMenu.attachSound("clickMenu");
var totBut = 7;
var indexArr = new Array();
var linkPage = 1;
var pathMenu = _root._menu;
var pathFooter = _root.footer._menu;
var pages = _root.pages;
var footStartPos = 129;
var footEndPos = Stage.width - footer._width;
var pageStartPos = _root.pages._x;
var pageEndPos = footStartPos;
var isOpen = false;
var flagPress = true;
var flagMenuBar = true;
var lastRoll = pathMenu["btn" + Math.ceil(totBut / 2)];
var getHomePage = function ()
{
for (i = 1; i <= totBut; i++)
{
var _loc1 = pathMenu["btn" + i];
if (_loc1._index == 1)
{
return (_loc1);
} // end if
} // end of for
};
var hideMenu = function ()
{
for (i = 1; i <= totBut; i++)
{
pathMenu["btn" + i]._alpha = 0;
pathFooter["btn" + i]._alpha = 0;
} // end of for
};
var hideBar = function ()
{
pathMenu.menuBar._alpha = 0;
};
var showBar = function ()
{
pathMenu.menuBar._alpha = 100;
};
var moveBar = function (mcTarget, speed)
{
new mx.transitions.Tween(pathMenu.menuBar, "_y", mx.transitions.easing.Strong.easeOut, pathMenu.menuBar._y, mcTarget._y, speed, true);
};
var switcher = function (mcTarget, speed)
{
flagMenuBar = false;
hideMenu();
showBar();
roll(pathMenu["btn" + Math.ceil(totBut / 2)], 1);
var _loc1 = new mx.transitions.Tween(pathMenu.menuBar, "_y", mx.transitions.easing.Strong.easeOut, pathMenu.menuBar._y, mcTarget._y, speed, true);
_loc1.onMotionFinished = function ()
{
flagMenuBar = true;
hideBar();
roll(lastRoll, 1);
moveBar(lastRoll, 1.000000E-002);
};
};
var roll = function (mcTarget, speed)
{
var _loc1 = 100;
var _loc3 = 100;
new mx.transitions.Tween(mcTarget, "_alpha", mx.transitions.easing.Strong.easeOut, mcTarget._alpha, _loc1, speed, true);
new mx.transitions.Tween(pathFooter[mcTarget._name], "_alpha", mx.transitions.easing.Strong.easeOut, mcTarget._alpha, _loc1, speed, true);
for (i = mcTarget.pos + 1; i <= totBut; i++)
{
_loc1 = Math.round(_loc1 / 1.450000E+000);
new mx.transitions.Tween(pathMenu["btn" + i], "_alpha", mx.transitions.easing.Strong.easeOut, pathMenu["btn" + i]._alpha, _loc1, speed, true);
new mx.transitions.Tween(pathFooter["btn" + i], "_alpha", mx.transitions.easing.Strong.easeOut, pathFooter["btn" + i]._alpha, _loc1, speed, true);
} // end of for
for (i = mcTarget.pos - 1; i >= 1; i--)
{
_loc3 = Math.round(_loc3 / 1.450000E+000);
new mx.transitions.Tween(pathMenu["btn" + i], "_alpha", mx.transitions.easing.Strong.easeOut, pathMenu["btn" + i]._alpha, _loc3, speed, true);
new mx.transitions.Tween(pathFooter["btn" + i], "_alpha", mx.transitions.easing.Strong.easeOut, pathFooter["btn" + i]._alpha, _loc3, speed, true);
} // end of for
};
var checkText = function ()
{
if (pathMenu.menuText._y < 0)
{
pathMenu.menuText._y = pathMenu.menuText._y + 210;
} // end if
if (pathMenu.menuText._y > 180)
{
pathMenu.menuText._y = pathMenu.menuText._y - 210;
} // end if
};
var moveText = function (num)
{
var _loc1 = new mx.transitions.Tween(pathMenu.menuText, "_y", mx.transitions.easing.Strong.easeOut, pathMenu.menuText._y, pathMenu.menuText._y - num * 30, 1, true);
Math.round(pathMenu.menuText._y);
checkText();
_loc1.onMotionFinished = function ()
{
Math.round(pathMenu.menuText._y);
checkText();
};
};
var buildIndexArr = function (num)
{
var _loc1 = new Object();
var _loc2 = num - Math.ceil(totBut / 2);
moveText(_loc2);
if (_loc2 != 0)
{
if (_loc2 > 0)
{
for (i = 0; i < _loc2; i++)
{
_loc1 = indexArr.shift();
indexArr.push(_loc1);
} // end of for
} // end if
if (_loc2 < 0)
{
for (i = 0; i < Math.abs(_loc2); i++)
{
_loc1 = indexArr.pop();
indexArr.unshift(_loc1);
} // end of for
} // end if
} // end if
};
var reWrite = function ()
{
for (i = 1; i <= totBut; i++)
{
var _loc1 = pathMenu["btn" + i];
_loc1._index = indexArr[i - 1];
} // end of for
};
var openPage = function (mcTarget)
{
linkPage = mcTarget._index;
pages.gotoAndStop(linkPage);
buildIndexArr(mcTarget.pos);
reWrite();
var _loc1 = new mx.transitions.Tween(footer, "_x", mx.transitions.easing.Strong.easeOut, footStartPos, footEndPos, 1, true);
new mx.transitions.Tween(pages, "_x", mx.transitions.easing.Strong.easeOut, pageStartPos, pageEndPos, 1, true);
flagPress = false;
pages.pageAnim.gotoAndPlay("start");
pageMask.gotoAndPlay("start");
footer.gotoAndPlay("start");
_loc1.onMotionFinished = function ()
{
isOpen = true;
};
};
var closePage = function (mcTarget)
{
linkPage = mcTarget._index;
buildIndexArr(mcTarget.pos);
reWrite();
var _loc1 = new mx.transitions.Tween(footer, "_x", mx.transitions.easing.Strong.easeOut, footEndPos, footStartPos, 1, true);
new mx.transitions.Tween(pages, "_x", mx.transitions.easing.Strong.easeOut, pageEndPos, pageStartPos, 1, true);
flagPress = false;
_loc1.onMotionFinished = function ()
{
isOpen = false;
flagPress = true;
pages.gotoAndStop(linkPage);
pageMask.gotoAndPlay(1);
};
};
var changePage = function (mcTarget)
{
var _loc1 = new mx.transitions.Tween(footer, "_x", mx.transitions.easing.Strong.easeOut, footEndPos, footStartPos, 1, true);
new mx.transitions.Tween(pages, "_x", mx.transitions.easing.Strong.easeOut, pageEndPos, pageStartPos, 1, true);
isOpen = false;
flagPress = false;
buildIndexArr(mcTarget.pos);
_loc1.onMotionFinished = function ()
{
linkPage = mcTarget._index;
pages.gotoAndStop(linkPage);
reWrite();
new mx.transitions.Tween(pages, "_x", mx.transitions.easing.Strong.easeOut, pageStartPos, pageEndPos, 1, true);
var _loc1 = new mx.transitions.Tween(footer, "_x", mx.transitions.easing.Strong.easeOut, footStartPos, footEndPos, 1, true);
flagPress = false;
pages.pageAnim.gotoAndPlay("start");
pageMask.gotoAndPlay("start");
footer.gotoAndPlay("start");
_loc1.onMotionFinished = function ()
{
isOpen = true;
};
};
};
for (i = 1; i <= totBut; i++)
{
var butName = pathMenu["btn" + i];
butName._index = i + Math.ceil(totBut / 2);
if (butName._index > totBut)
{
butName._index = butName._index - totBut;
} // end if
butName.pos = i;
indexArr.push(butName._index);
butName.onRollOver = butName.onReleaseOutside = function ()
{
lastRoll = this;
if (flagMenuBar)
{
moveBar(this, 1.000000E-002);
roll(this, 1);
clickMenu.start();
} // end if
};
butName.onRollOut = function ()
{
lastRoll = pathMenu["btn" + Math.ceil(totBut / 2)];
if (flagMenuBar)
{
roll(pathMenu["btn" + Math.ceil(totBut / 2)], 1);
moveBar(pathMenu["btn" + Math.ceil(totBut / 2)], 1.000000E-002);
} // end if
};
butName.onRelease = function ()
{
if (flagPress)
{
if (!isOpen)
{
if (this._index != 1)
{
openPage(this);
switcher(pathMenu["btn" + Math.ceil(totBut / 2)], 1);
}
else if (linkPage != 1)
{
linkPage = 1;
pages.gotoAndStop(linkPage);
buildIndexArr(this.pos);
reWrite();
switcher(pathMenu["btn" + Math.ceil(totBut / 2)], 1);
} // end else if
}
else if (this._index == 1 || this._index == linkPage)
{
closePage(this);
switcher(pathMenu["btn" + Math.ceil(totBut / 2)], 1);
}
else
{
changePage(this);
switcher(pathMenu["btn" + Math.ceil(totBut / 2)], 1);
} // end else if
} // end else if
};
} // end of for
pathMenu.menuBar.setMask(pathMenu.barMask);
pathMenu.menuText.setMask(pathMenu.textMask);
pages.setMask(pageMask);
hideBar();
roll(pathMenu["btn" + Math.ceil(totBut / 2)], 1.000000E-002);
checkText();

View Replies !    View Related
Remove Movie Clip
I currently am attaching a movie clip with the following

radios[radionum] = this.attachMovie("FRadioButtonSymbol", "Button"+radionum, -200+radionum);

How would I remove this clip by using the "myMovieClip.removeMovieClip()"??????

Any help would greatly be appreciated

View Replies !    View Related
Remove Movie Clip?
Hello, this is a very basic question but I can't find an answer anywhere.

How do I remove a movie clip from the stage? I have an MC instance on a timeline that I call with one button (using telltarget), then I need another button to remove it.


I thought removeMovieclip (duh) would work but apparently only works with duplicated movieclips

Please help!

View Replies !    View Related
Remove Movie Clip
Hi there, i made a button with this actions:

--
on (press) {
if (count < 40) {
count++;
duplicateMovieClip ("myMC", "myMC" + count, count);
["myMC" + count]._x = 29 + count;
["myMC" + count]._y = 2 + count;
}
}

--

now I want to make a button to remove all movies at the same time, with one clik. how can I do that?
and if it's possible to put that actions to a frame.

View Replies !    View Related
Remove Movie Clip
hmm I am having trouble with this.
-------------------
Frame 2 ----------
-------------------

duplicateMovieClip(ball, ball+i, i)
i++

-------------------

if (ball+i._x < 0){
gotoAndPlay(1)
}

-------------------
Frame 1 ----------
-------------------

removeMovieClip(ball+i);

View Replies !    View Related
Remove Movie Clip
hmm I am having trouble with this.
-------------------
Frame 2 ----------
-------------------

duplicateMovieClip(ball, ball+i, i)
i++

-------------------

if (ball+i._x < 0){
gotoAndPlay(1)
}

-------------------
Frame 1 ----------
-------------------

removeMovieClip(ball+i);

View Replies !    View Related
Remove Movie Clip
I know this is simple but please give the code for removing a movieclip with a target of itself.
Thankyou

View Replies !    View Related
Remove Clip Doubts?
Hi,
I've a problem.... let me show the code.....

PHP Code:




mc_bau.attachMovie("mc_videos", "menu_video",this.getNextHighestDepth());
mc_bau.removeMovieClip()







The problem is that I can't remove the clip (mc_bau) from the stage. Can Someone explain how remove clip works? and the direfence of removeClipMovie("xxxx") ????????

Tks
William

View Replies !    View Related
Remove Movie Clip
function main_loadbuttons() {

for (i=0; i<mainNames.length; i++) {
spacing = button._height+5;
name = "mainBtn"+i;
button.duplicateMovieClip(name, i);
set("mainBtn"+i+".text", mainNames[i]);
set("mainBtn"+i+".swf_file", Swf[i]);
setProperty("mainBtn"+i, _x, 23);
setProperty("mainBtn"+i, _y, 167+(i*spacing));
}
}

ok, I made these set of movies now I need a function that can be called to remove each clip. How would I do that? this part always confuses me. this is what i had and its not working:

function removeButtons(name) {
for (i=0; i<10; i++) {
name+i.removeMovieClip();
}
}

then when I call the function I type removeButtons("mainBtn");

this is wrong... but how do I fix it.. I think it's something like that

View Replies !    View Related
Remove Movie Clip
Hello Peoples!

I was wondering if someone could help me out.

I just found out from a previous question I posted, how to duplicate 10 movieclips at a 10 into different depths by the click of a button.

Now what I would like to do, is be able to have the option of removing 10 MC's at a time from one click of a button.

Many thanx in advance for the help.

, Lowell

View Replies !    View Related
Remove Movie Clip
ok i want on frame 30 for a movie clip to be removed.

i have this code on frame 30 of the movie clip

this.removeMovieClip();

View Replies !    View Related
Remove Movie Clip?
Okay so I've been working on a portfolio and as of right now I only have the basic idea set up, yet I've run into a problem. If you click my "contact" link the contact box comes up. If you click my Websites link the website text comes up, but is underneath the contact box. What I need is for the contact box, or any other MC I have on that area to be taken off when another button is clicked...I've tried the remove movieclip code but it dosent seem to be working..
heres a copy of my .fla if anybody can take a work. I'm having the same problem with the "welcome' text. That should be taken off when either button is clicked.

View Replies !    View Related
Remove Movie Clip...i Know..im Sorry..
hi peeps,

first post and a newbie really.

so hopeing for some help. i hope this is the right section as im using flash mx and as2.

right...

whe the timeline reaches a frame a movieclip appears in stage..i have use the actinscript on the timeline:-


this.attachMovie("a_mc1", "window", 0);
window._x = 250;
window._y = 180;

at this point on the stage the user has three answers to choose from, one is the right answer, but when they choose the wrong answer i want them to go back to the start.

sooo...when the time line gets back to the start i have put the code on the timeline:-

this.removeMovieClip("a_mc1","window",0)
window._x = 250;
window._y = 180;

this wouldnt work.

any ideas guys? im really stuck, ive spend a whole day trying to work it out with no success...

ive tried different actionscript..like:-

"a_mc1".removeMovieClip("window");

but still no luck..

i would be really greatgul if anyone cant assist me..

thanks

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