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




Changing Events With DuplicateMovie



I want a MovieClip to be 'replaced' when the original is moved but don't want the moved clip to be duplicated when it is moved again. The scenario is to be able to take coins from an "endless pile".I've used the Behaviours menu to make the MovieClip duplicate when it is clicked and dragged. Unfortunately for me in this case, the duplicate MovieClip contains the events of the original, and so each coin can be duplicated, not just the original one. Can someone give me an idea of how to change the properties of the duplicated movieclip or offer an alternative way to keep replacing my coins when they are moved.Many thanks.Niven



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 05-12-2008, 01:18 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Changing Graphics On Events
hey guys

how would i get a graphic to change depending on an event or state.

in other words, if state=x then graphic = y else if state = a then graphic = b.

does that make sense?

im pretty sure i would use intansce names.

maybe having 2 graphics, 1 on top of the other, and then switching the visible state? i guess that would be the easiest way...

any ideas?

gkc

Events Changing Type
i'm having a strange problem with events in AS3. in many cases, i dispatch a custom event that subclasses Event, and my handler shows the incoming event param as an Event, not as the custom subclass.

i still haven't been able to figure out exactly why this is happening, but i thought maybe someone else has run into a similar problem and would like to enlighten me? please?

thanks...

Changing MC's Level On Mouse Events...pls Help
Hi

I've got four MCs overlapping eachother, and each MC has a button. So what I want to do is when I roll over a MC it should be "sent to front", if you know what I mean?
For example how one would determine the level of each MC when creating the swf in flash.

So basically I'm wondering how I can change the level of MCs so I can arrange them in the flash movie with mouse events.


Thanks for any help

Display Objects And Changing Images On Mouseover Events
<p>Hi: I'm trying SO hard to get on the OOP bandwagon and have made loads of progress, but some things just aren't clickin' for me yet. The issue that I'm having is as follows:
<p>
I have 2 arrays of images, one containing an image and the other containing its rollover counterpart. I have a loop that assigns each image to a movieclip, then both movieclips to a container movieclip. I set the alpha of the rollover to 0. On the MOUSE OVER event, I am trying to set the alpha back to 100, but can't figure out how to access the movieclip within the container.


ActionScript Code:
for (var p:int=0; p<thumbOnLoaderArray.length; p++)
     {
     thumb = new MovieClip;
     addChild(thumb);
     thumbOff = new MovieClip;
     thumbOn = new MovieClip;
     thumbOff.addChild(thumbOnLoaderArray[p].content);
     thumbOn.addChild(thumbOffLoaderArray[p].content);
     thumb.addChild(thumbOff);
     thumb.addChild(thumbOn);
     thumb.addEventListener(MouseEvent.MOUSE_OVER, overThumb);
     thumb.addEventListener(MouseEvent.MOUSE_OUT, offThumb);
}         
           
           
       
function overThumb(event:MouseEvent):void {
    //event.target.getChild ------ ?????
    //thumb.thumbOff.alpha = 0; 
}
       
function offThumb(event:MouseEvent):void {
    //thumbOff.alpha = 100;
}

Duplicatemovie
i have done som lines of code that duplicates a movie (with a :"for x" ( in this one there are dynamic texts and button behaviour...)

i want all of them NOT to appear in one time...

how can i do this?

DuplicateMovie Help
Trying to duplicate a movie clip, then offset each successive on from the previous by 100px on the ._x axis. i feel i am reasonably close... (maybe?)
The ("new_mc"+i-1)._x =100 was my feeble attempt.


Code:
amount = 3;
for (i=1; i<amount; ++i) {
original_mc.duplicateMovieClip("new_mc"+i, i)
setProperty("mc"+i, _x, ("new_mc"+i-1)._x +100)
}


also, the movieclip.duplicateMovieClip(newname, property, level [initClip]) method seems be quite useful if i want to pass values to variables in the new clips. does anybody have an example of this i could follow.

finally, i seem to remember being able to search the boards, and not just the Movies, Tutorials, Links etc. if so, how? there's so much more practical info in the boards.

thank you in advance. (phew, what a mouthful)

DuplicateMovie Help?
Quick question that you all might be able to help me with. On a button click, a duplicate of a mc is created. The user must be able to turn the visibility of these mc's on/off. The issue i have is the duplicate MC's name is newEvent+i. where i++ on every click. I do not know how to call all of the duplicates at the same time to change visiblity. Any ideas?

DuplicateMovie Help
Hello all,
I've just ran into another problem that I know is super simple to solve and I'm sure I have 90% of the code right, but it's just not working. I'm trying to duplicate a movieclip 10 times. The movie clip is just a red square on the stage called "button". I know the movie's being duplicated and all I'm left with is the last one, but I don't understand why. The getNextHighestDepth() function is in there, I know it's incrementing. Only thing I can think of is that the instance name of the new movieclip isn't incrimenting like I want it to. Thanks again.


ActionScript Code:
var j = 0;
var k = 0;

for(i=1; i<11; i++) {

    duplicateBtn(i);
}   

function duplicateBtn(i) {

    duplicateMovieClip(this.button, "button"+[i], this.getNextHighestDepth());
    _x = j;
    _y = k;
    j = j + 10;
    k = k + 10;
}

DuplicateMovie() Help
Ok.... So i have this string that I am splitting up into an array, now I need to loop through that array and create/duplicate a MC for each [i] in that array. So far I have this, but its not making new MC's?


Code:
// Where "brand" is my array.... and "brandMC" is the MC I want duplicated

for (i in brand) {
xPos +=20;
yPos +=20;
brandMC.duplicateMovieClip("brand"+i, this.getNextHighestDepth(), {_x:xPos, _y:yPos});
trace(brand[i]);
}
///end array loop
But nothing happens???? The only thing I have in the brandMC is a dynamic textfield that I will need to figure out how to populate with the brand[i].value.

Any suggestions? Ultimately I am going to have them randomly move about the stage.

Thanks AS!

XML And DuplicateMovie
Following problem ...

I have an XML File which contains 25 Links ...

I wanted to duplicate a Button (which is in a MC) 25 Times and assign the 25 Links to each of the buttons ... any1 has sumthing like that or can point me in the right direction (Tutorial or File) ...

thanx in advance

ChromeD

Newbie Help With Duplicatemovie
Thanks for taking the time to help a flasher in training. I have been searching everywhere for a guide on how to use duplicateMovie to create several instances of a MC on my stage at random x,y positions with random movements. I am trying to create a nice background for one of my training projects and would like to use this effect(instead of manually creating all the tweens myself all on seperate layers... after all that is why I am trying to learn this ActionScripting isnt it) So if anyone has a great definative guide for creating say 30+ duplicate MC, how to randomly assign movements of MC (w/in the stage...do I need to constrain the MCs to the Stage dimensions?) I would be greatly indebted.
I have seen a fla file of a movie that has this function but it is very complicated and I cannot break it down to LEARN it...and I want to learn this principle(plus some of the code was in spanish!)
Please help out here.... or make a tutorial for all us newbs.... or if there is one out there please just direct me in the right path.
Many Thanks
Pazul

Duplicatemovie Limiter
hey guys, I've got a Flash 5 navigation that uses duplicate movie every time the user rolls over something. This creates a nice effect but as you can imagine, if the user moves the mouse to fast.....it lags big time. Anyway, I've been trying to figure out a limiter that would only allow 5 movies to be playing at once. My problem is that if someone goes crazy and moves the mouse a bunch, the 5 movies keep restarting. Instead of just telling the duplicated movies to go back to frame 1 I'd like for the movies to play through and then wait for another rollover before they can start again. On rollover this is the code that I am triggering:


Code:
function overbub(){
stop();
//to limit the items to 5
if (bubCounter < 5) {
trace ("bub == " + bubCounter);
//if the movies we're looking at is at frame 1 or frame 161 (not playing) recreate it and increment the variable
if (_root["bubbles"+bubCounter]._currentframe < 1 || _root["bubbles"+bubCounter]._currentframe > 160) {
bubCounter++;
_root.bubL1.bub.duplicateMovieClip( "bubbles"+bubCounter, bubCounter);
}
else {
//otherwise don't do anything.
trace ("clips are currently playing")
}
}
else {
//once the counter gets past 4, reset it to zero.
bubCounter = 0;
trace("bub has been reset to 0")
}
}


the file: http://www.fusionmedia.net/help/nav9.zip

thanks in advance guys,
[Edited by fusionmedia on 06-25-2002 at 09:51 AM]

DuplicateMovie Problem
look at the attached *.fla file and tell me why it doesn't work

menu --> home (these actions)

Layer Of Duplicatemovie
I have a script which duplicates a movie 30 times in a while loop. The layer the movie is on to be duplicated is below a layer with an image in it. When the movie is duplicated 30 times they are now on top of the layer with the image. So the question is how can you set the layer the movie will be duplicated to. As I understand the depth parameter has nothing to do with layers. Here is my script


count = 1;
while (count<30) {
_root.ball.duplicateMovieClip("ball"+count, count);
count += 1;
}


Thanks in advance

ActionScript Help DuplicateMovie
Ok, I have a movie clip (Boom) that plays then stops on a blank frame. I place Boom out of my stage area. Then I put the following script in Boom:

Code:
onClipEvent (load) {
num = 0;
}
onClipEvent (mouseDown) {
this.duplicateMovieClip("Boom"+num, num);
_root["Boom"+num]._x = _root.thing._x;
_root["Boom"+num]._y = _root.thing._y;
num++;
}

On every click it's to make a duplicate of Boom to play only once at the position on 'thing', instead it plays the first click , then the first and second, then the third, then the second and fourth... you get the idea? It's to play the first, then the second, then the third, etc...

Duplicatemovie Problems
Hello everyone. I designed an effect that involves duplicating a movieclip several times. The movieclips duplicate and clear in set intervals. Everything works fine accpet, the duplicated movieclips always appear on top of everything else on my stage. Even if i put the movieclip on a seperate layer, behind everything else, the duplicated movies always appear on top. How do i get them to stay behind an object, for example a trasparent gif ? Again this problem is at run time.

DuplicateMovie Command
I'm trying to have a movie clip duplicated depending on how many links I need to have for a menu. I'm using Flash Mx. The while command is working but the duplicating of the movie is not.

I havn' even started to figure out how to allow for more then a certain amount. I'd like to load extra clips outside of a mask and write a function to scroll them over eventually. first I need to figure out how to duplicate these movies.

Here's the code:

Code:
ArtLinks = 5;
LinksCreated = 1;
while (ArtLinks >= LinksCreated) {
NewLinkNumber = LinksCreated++;
duplicateMovieClip("_root.openArt"&LinksCreated, "_root.openArt"&NewLinkNumber, NewLinkNumber);
trace("_root.openArtLinks"+NewLinkNumber);
setProperty("_root.openArt"&NewLinkNumber, _x, 744-(NewLinkNumber*27));
LinksCreated = Linkscreated++;
}
trace("Finished");

DuplicateMovie And AttachMovie
Hi all,

Just wondering how to accomplish loading a clip from library (symbol1) onto the stage and then duplicate the same after it loads onto the stage.

onClipEvent (enterFrame) {
_root.attachMovie("act-a", "narrow"+i, 2+i);
for (i=0; i<num-1; i++) {
_root.duplicateMovieClip("narrow"+i, 2+i);
}
}

is this it?

DuplicateMovie And Position
I have the script below on a movieclip called horLine on the root of the stage. The movie clip duplicates ok but it is doing random things. When i do the trace myVar i start getting a trace of more and more number the more i click.

Hope it makes sense and im sure plenty of people know the fix......... thankyou

onClipEvent (load) {
myVar = 1;

}
onClipEvent (mouseDown) {

duplicateMovieClip(_root.horLine,"horLine"+myVar, myVar);
//setProperty ("horLine"+myVar, _x, _root._xmouse);
_root["horLine"+myVar]._x = _root._xmouse ;
_root["horLine"+myVar]._y = _root._ymouse ;
myVar++;
trace(myVar);
}

Problem With DuplicateMovie
Hey, im using this in onClipEvent(enterFrame) {} on the symbol obj. When i hit space it does duplicate the video and fire but the X and Y dont transfer.


Code:
if (Key.isDown(Key.SPACE)) {
_root.count++;
str = "_parent.fire"+_root.count;
duplicateMovieClip(_parent.fire, str, _root.count);
fire = eval(str);
fire._x = _x;
fire._y = _y;
fire._rotation = _rotation;
trace("Name: "+str+" X:"+_x+" x:"+fire._x+" Y:"+_y+" y:"+fire._y);
fire.gotoAndPlay(2);
}
now that displays this in the trace if i hit space twice:
Name: _parent.fire2 X:60.55 x:undefined Y:380 y:undefined
Name: _parent.fire3 X:60.55 x:undefined Y:380 y:undefined

anyone got an idea? Ive been thinking on it forabit but cant figure out why.

DuplicateMovie Troubles
I tried the search, and I couldn't find anything to really help me out, or I wouldn't bother posting.

I'm trying to make a bit stream across my page when you mouseover a button. The bit stream can be quite long, so I wouldn't think to do it by hand.

I'm wondering how I would go about making the stream start out, and how I can get each bit to follow the other right behind it. (They're about 10 pixels wide)

I can get the for loop to duplicate the clips, but I can't seem to get them in order.

Any help would be appreciated!

Offsetting DuplicateMovie
i'm trying to use a duplicateMovie function in conjunction with setInterval, to create a similar transition effect on the page seen here when you click on a link. i can duplicate the movies just fine, but am having difficulty offsetting them from eachother.

this is my code in the frame, the clip is labeled door.
Code:
i = 1;
loop = 1;
function dupMc(theClip, numTimes) {
duplicateMovieClip(theClip, "theClip"+i, i);
with ("theClip"+i) {
setProperty("theClip"+i, _x, 163.1+i*82);
i++;
}
}
while (loop<5) {
setInterval(dupMC(door, 5), 500);
loop++;
}
anyone have any suggestions?

Scroller, Xml, Duplicatemovie?
Right, I'll try and explain this best I can...

I'd like to have a scrollbar which scrolls movieclips that are created depending on whether there is the information available in an xml file.

The image attached shows how the layout should be and the xml will be something like this:


Code:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<myentry>
<title>Title 1</title>
<description>Description 1</description>
</myentry>
<myentry>
<title>Title 2</title>
<description>Description 2</description>
</myentry>
<myentry>
<title>Title 3</title>
<description>Description 3</description>
</myentry>
....etc....
</root>
If there are any examples I'd be greatly appreciative.

The kind of thing I want to create can be seen here... http://www.seewindowsvista.com.
Click on 'engaging customers' and then you'll see a box to the right.
I want to create something like that, but loading in the text from xml.

The scrollbar found here is good but I can't see how to implement the whole adding movieclips dynamically and then resizing the scrollbar etc.. http://www.kirupa.com/forum/showthread.php?t=206127

Does this all include: loading in the xml, finding the node, creating a new movieclip, adding the xml information, resizing the scrollbar and then checking to see if there are anymore xml nodes?

Thanks for any help given.

My DuplicateMovie Duplicates In Very Odd Way...
Hi,

Something very odd is happening when the clip is duplicated...see attachment. Where am I going wrong if I just want the clip to be duplicated and I don't want the original clip visible otherwise the context menu would be pointless.. Notice what happens when you right-click a second time and try to extend the clip. Why is the re-size button off the MC?

code on the frame
ActionScript Code:
root_cm = new ContextMenu();
root_cm.hideBuiltInItems();
root_cm.customItems.push(new ContextMenuItem("Add card", itemHandler));
function itemHandler(obj:Object, item:ContextMenuItem) {
for (i=0; i<100; i++) {
card1.duplicateMovieClip("card1"+i, i);
}
};
_root.menu = root_cm;




code to re-size the clip:
ActionScript Code:
onClipEvent (enterFrame)
{
if (pressing == true)
{
_parent.textbox._width = _x + 37;
_parent.textbox._height = _y + 32;
_parent.drag_mc._y = _y + 15;
_parent.drag_mc._x = _parent.textbox._width / 2;
} // end if
if (_parent.dragging == 1)
{
} // end if




}

DuplicateMovie Troubles
I tried the search, and I couldn't find anything to really help me out, or I wouldn't bother posting.

I'm trying to make a bit stream across my page when you mouseover a button. The bit stream can be quite long, so I wouldn't think to do it by hand.

I'm wondering how I would go about making the stream start out, and how I can get each bit to follow the other right behind it. (They're about 10 pixels wide)

I can get the for loop to duplicate the clips, but I can't seem to get them in order.

Any help would be appreciated!

Offsetting DuplicateMovie
i'm trying to use a duplicateMovie function in conjunction with setInterval, to create a similar transition effect on the page seen here when you click on a link. i can duplicate the movies just fine, but am having difficulty offsetting them from eachother.

this is my code in the frame, the clip is labeled door.
Code:
i = 1;
loop = 1;
function dupMc(theClip, numTimes) {
duplicateMovieClip(theClip, "theClip"+i, i);
with ("theClip"+i) {
setProperty("theClip"+i, _x, 163.1+i*82);
i++;
}
}
while (loop<5) {
setInterval(dupMC(door, 5), 500);
loop++;
}
anyone have any suggestions?

DuplicateMovie With A Component
This is weird. I have this component that dupicates itself with duplicateMovie.
the component has another component inside that has a button. I can't get the button to make any calls. Not even: trace ("hello");

Is there some rule about having components inside components?
Thanks.

DuplicateMovie -- How Many Movies In The Scene ?
Hi,

I made online- character chatting.
Whenever new user logins, it duplicate character in the scene.

later, I want to know , how many character movie clip there are in current scene and their name.


How can I know that?


thanks a lot

CheckBox And Duplicatemovie Clips
Help for Check Box.
This is my code which is used to call a checkbox. There is a function call render inside the movieclip which is called upon by a movie in the root.
Question is, when we duplicate movie clip, is the functions still inside the duplicated ones. it seems that I cant call the function render from the duplicated movie clip. This function works ( RadioButton.render(node) ) but not
eval(mainpath).render(node).
Why??
Please help.


stop();

stripWhitespaceDoublePass(xData);
var rootNode = xData.firstChild;
buildquestion(rootNode);

function buildquestion(rootNode)
{
for (var index=0; index < rootNode.childNodes.length;index++)
{
var type = rootNode.childNodes[index].attributes.type;
var yposition = rootNode.childNodes[index].attributes.ypos;
if (type == "CheckBox")
{

duplicateMovieClip("CheckBox", "CheckBox" + index, index);
var mainpath = this["CheckBox" + index];
_root.mainpath._x = 250;
_root.mainpath._y = yposition;
eval(mainpath).render(rootNode.childNodes[index],yposition,index);
}

}

_global Counter For DuplicateMovie()
I am setting up a counter so that when I duplicate a movie clip it will have a varible level insted of writeing 1,2,3 ect. What I am wondering is what is the best whay to do this accross multiple swfs.. should I use _global or should I use some sort of prototype.

Thanks

Actionscript To DuplicateMovie Function
Hello to all. I appreciate any help that can be given!

I am making a flash presentation for a construction company that will run off of projector on a CD-ROM. I need to create clickable buttons for over 60+ individual roof sections that will take them to a movie clip I have created with details of that section. Currently, I manually copy and paste my movie 60+ times and changes the externally loaded variables (from .txt file) by hand.

Is it possible to create script that would take an inputted number of sections and duplicate my clip that many times and increase the variable names by 1?

example..roof1type...next duplicated clip would change this value to roof2type.

Second question: can actionscript be written to also make frame labels for each of these 60+ sections so my clickable buttons can reach their correct destinations?

I'll worry late about the "how's" right now I'd like to know if what i want to do is even possible. Remember, I am using projector files!

Thanks to all who assist!

DuplicateMovie( ) With Embedded Font
I have a titling SWF which creates drop shadows, embossing, glows, etc.

I can make extra titles on screen by using duplicateMovie( ) to make copies of the titling SWF.

Is it better to use a Shared Font (import TimesNewRoman.swf etc etc) so that all those copied title SWFs use the same copy of the font file, or should I just embed the font into the titling SWF and use duplicateMovie( ) ??

Will duplicateMovie( ) make copies of the font data as well ? If I made ten copies of a SWF which had an embedded font, would I end up with ten copies of the font? Or is Flash smart enought not to do that...

Thanks.

Troubles With AttachMovie / DuplicateMovie
I'm trying to create a simple application where a user clicks on a defined movie clip named "mcMap" and it leaves a small dot at each place he clicks. The dots are currently just instances of a movie clip in the library with a linkage name of "CircleSymbol". Here is the code I came up with:

Code:
stop();
var i:Number = 0;
mcMap.onPress = function(){
i++;
_root.attachMovie("CircleSymbol",
"mcCircle" + i,
mcMap001.getNextHighestDepth(),
{_x: _xmouse, _y: _ymouse});
};
Although the code allows the user to drop a dot where he clicks, it also erases the previous dot after each subsequent click which is something I don't want to happen. I want the user to be able to click and drop a dot and then drop more and more dots as he continues clicking ... all the while leaving the other dots on the "mcMap" movie clip after each click.

I tried using duplicateMovieClip through this code:

Code:
stop();
var i:Number = 0;
mcMap.onPress = function(){
i++;
mcCircle.duplicateMovieClip("mcCircle" + i,_root.getNextHighestDepth,mcCircle);
mcCircle["mcCircle" + i]._x = _xmouse;
mcCircle["mcCircle" + i]._y = _ymouse;
};
However, that won't even show one dot after each click. I'm not sure what I am screwing up. When I used a trace statement to debug I find that my depth is undefined so I think that probably has something to do with it.

I am using Flash Prof 8.

[MX] Drag And Drop With DuplicateMovie
Hi all,

I have a movie clip with three boxes. one box is a drag item I want to duplicate. This item drags to correct or incorrect drop areas. When dropped I want the movie to duplicate. I can't quite get the code the way I want. Any idea on how I can accomplish this? From here I would then probably use an array to determine which drops were right/wrong.
Thanks

i = 0;
function dupe() {



startDrag("box"+i);


}
function match() {
if ("box"+i.hitTest(correct_mc)) {
trace("you hit the correct");

}
}

box1.onPress = function() {

this.startDrag();

};
_root["box"+i].onRelease = function() {
stopDrag();

match();
box._x = 207;
box._y = 77;
i = i+1;
duplicateMovieClip(_root.box, "box"+i, i);
};

Duplicatemovie Array Targeting
Hello,

I can never get this right. I want to dynamically create movie clips and then move them all by targeting them dynamically.

The problem is, when I hard code the object name it works, but when I try to use an array it does not. I want to pass a var to the [j] value so that I can target and move all the MCs created dynamically.


Code:
if (count<totalMCs) {
count++;
newName = "receiver"+count;
_root.receiver.duplicateMovieClip(newName, count);//creates a duplicate movie or receiver
}
}

_root.onEnterFrame=function(){
j=0;
if(j<_root.totalMCs){
trace(receiver1._x);//works

trace(receiver[j]._x;//does not work!

j++;
}
}

DuplicateMovie From Root Problem
Hi everybody

I have a problem duplicating a movieclip located in _root into my movieclip.

I would prefer to load the movieclip from within the movieclip its supposed to be placed in.. so i try soemthing like this:

duplicateMovieClip("_root.duplicateMe", "this.Duplicated", this);


also tried:

_root.duplicateME.duplicateMovieClip("Duplicated", this);

any hints on why it wont work??

Duplicatemovie #' Within Another Existing Movie;'#;[p
Hello,
here's my scenario.
I have in my library a class of objects: nodes
I have then a main window W.
Inside this window W I have an instance 'a' of nodes, attached to W as a movie clip 'A' (that is _level0.W.A)
Within 'A' other instances of nodes have been created and attached as movie Clips
Now I want to create an instance B of nodes, attach it to the main window W and attach to this instance the movie Clip A ... I cannot use the attach movie 'cause it needs a Class identifier and not an instance as argument ... and if I try to create a duplicate of A (sorry W.A), In fact i don't know how to specify that it has to be duplicated inside B (that is W.B) ....
Help me please ....

Html Texfield And Duplicatemovie
Hi everyone, i ld need some help because this getting me dumb..
I have a script with a movieclip wich i duplicate with duplicateMovieClip.
In this movieclip there is a texfield with many properties

Code:
txt_content.multiline = true;
txt_content.selectable = true;
txt_content.type = "dynamic";
txt_content.wordWrap = true;
txt_content.autoSize = true;
txt_content.border = false;
txt_content.html = true;
txt_content._x = 0;
txt_content._y = 0;
txt_content._width = 300;

I m passing html text when duplicating each movieclip and assigning it to the textfield in the mc, but all the html code between tags is not showing up :// there is only flat text, everything in tags disseapears..

Its working if i m using a textarea but i cant find the same property like



Code:
txt_content.autoSize = true;



have you got anyidea plz ? thanks in advance.

Duplicatemovie Clip Problem
I have a bunch of bullets that come from a movie clip called "bullet" and i want them all to have there own seperate variable. Heres whats in my movieclip bullet...

Code:
onClipEvent (load) {
if (this._name != "bullet") {
this._x = _root.turret._x;
this._y = _root.turret._y;
this._scale = 100;
fuel = 10;
}
}
onClipEvent (enterFrame) {
this._x += 1
this._y += 1
fuel -= 1;
if (fuel == 0) {
this.removeMovieClip;
}
}
the variable is called fuel and i want each bullet to have its own fuel counter.

Html Texfield And Duplicatemovie
Hi everyone, i ld need some help because this getting me dumb..
I have a script with a movieclip wich i duplicate with duplicateMovieClip.
In this movieclip there is a texfield with many properties

Code:
txt_content.multiline = true;
txt_content.selectable = true;
txt_content.type = "dynamic";
txt_content.wordWrap = true;
txt_content.autoSize = true;
txt_content.border = false;
txt_content.html = true;
txt_content._x = 0;
txt_content._y = 0;
txt_content._width = 300;

I m passing html text when duplicating each movieclip and assigning it to the textfield in the mc, but all the html code between tags is not showing up :// there is only flat text, everything in tags disseapears..

Its working if i m using a textarea but i cant find the same property like



Code:
txt_content.autoSize = true;



have you got anyidea plz ? thanks in advance.

Duplicatemovie Clip Problem
I have a bunch of bullets that come from a movie clip called "bullet" and i want them all to have there own seperate variable. Heres whats in my movieclip bullet...

Code:
onClipEvent (load) {
if (this._name != "bullet") {
this._x = _root.turret._x;
this._y = _root.turret._y;
this._scale = 100;
fuel = 10;
}
}
onClipEvent (enterFrame) {
this._x += 1
this._y += 1
fuel -= 1;
if (fuel == 0) {
this.removeMovieClip;
}
}
the variable is called fuel and i want each bullet to have its own fuel counter.

Duplicatemovie Script Cripples PC
(This is Flash MX)

I am creating a movie that utilizes the duplicatemovieclip. However, it cripples my PC and slows the animation down to almost a stand still. Why is it doing this? Maybe I am not using the function properly?

On the movie 'objectanimation', I load the variables:
Code:
onClipEvent(load) {
delay = 2; // This will be the time between the appearance of each new object
x = 200; // The max X (right) position to start movie
y = 180; // The max Y (down) position to start movie
alpha = 50; // 100-alpha, so if you want alpha to never go below 80, set this to 20
scale = 50; // Use similar to alpha, but for size
}
Inside movie (which has another movie 'object')
Frame 1:
Code:
i = 1;
j = 1;
Frame 2
Code:
if (j == delay) {
duplicateMovieClip (_root.objectanimation.object, "object"+i, i);
setProperty ("object"+i, _x, random(x));
setProperty ("object"+i, _y, random(y));
setProperty ("object"+i, _alpha, 100-random(alpha));
scale = 100-random(scale);
setProperty ("object"+i, _xscale, scale);
setProperty ("object"+i, _yscale, scale);
j = 1;
}
j++;
i++;
Frame 3
Code:
gotoAndPlay(2);

DuplicateMovie & External Images
Last edited by Codemonkey : 2006-06-23 at 06:19.
























I am trying to duplicate a movie clip populated by externally loaded images created with attach movie:


ActionScript Code:
function initClips() {
    for (i=1; i<=splittedDataArray.length; i++) {
        this.Mholder_mc.holder_mc.attachMovie("img", "img"+i, i);
        //holder_mc.attachMovie("img", "img"+i, i);
        //this["img"+i]._alpha = 0;
        //this.Mholder_mc.holder_mc["img"+i]._x = i*70-70;
 
        var imageUrl:String = ("http://www.botnickchevrolet.com/images/marquee/"+splittedDataArray[i-1]+".jpg");
        myMCL.loadClip(imageUrl, this.Mholder_mc.holder_mc["img"+i]);
        //fade(100,100,this["img"+i]);
    }
}

then the duplicate comes somwhere else:

this.Mholder_mc.holder_mc.duplicateMovieClip(this.Mholder_mc,"holder_mc2",this.Mholder_mc.getNextHighestDepth());

what am i doing wrong? no exceptions or anything just dont work...

[AS] AttachMovie DuplicateMovie Problem
Here is my problem : I have MC's dynamically created inside an MC that is already on the timeline. I am trying to duplicate one of the dynamically created MC's from the main timeline into another MC, is that possible? I tried using duplicateMovieClip, but it seems to only work within the same MC, and attachMovie only works if the MC is in the library, which it can't be, since it's being dynamically created!

AttachMovie(),duplicateMovie() Or LoadMovie() ?
Hey All I'm having problems with a dynamic-preloading background image loader.

It works like this;

A loop creates sequentially numbered MCs (bg_1_mc) then loads a JPG into each MC.

The script waits until all images have finished loading.

My nav and container MCs then load.

When a nav element is clicked it is supposed to load one of the previously preloaded/created img_mcs.

nav1.onRelease = function(){
_parent.bg_container_mc.attachMovie("bg_1_mc", "bg_img_mc", 1);
}


The problem I am having is the attachMovie method does not seem to work, because I can not change the properties of the attachedMovie(bg_img_mc).

Is there a way of attaching already created movie clips to other movie clips?

Any help is appreciated,

Murmur

HELP? DuplicateMovie Doesend Work With Xml Obj
ActionScript Code:
onClipEvent (load) {
    objXml = new XML();
    objXml.ignoreWhite = true;
    objXml.onLoad = function($ok) {
        if ($ok) {
            $tekst = "";
            for ($i=0; $i<objXml.firstChild.childNodes.length; $i++) {
                $tekst = $tekst+objXml.firstChild.childNodes[$i].attributes.titel+"
";
                $newName = "blok"+$i;
                blok.duplicateMovieClip(eval("blok"+$i), getNextHighestDepth());
                //$newName._x = 0;
                //$newName._y = 0;
                setProperty(eval("blok"+$i), _x, 30);
                setProperty(eval("blok"+$i), _y, ($i * 30));
                eval("blok"+$i).onRelease = function() {
                    trace("JOJOJOJO");
                };
            }
        } else {
            $tekst = "error: XML file not loaded";
        }
    };
    objXml.load("mp3/list.xml");
}


i'm duplicating a button and then moving the duplicated button to a new position. The problem is that it just wont work. all variable uit of the loaded xml works. It just wont duplicate my movie. Is there something i'm not seeing. ore am i just STUPID.

CreateEmptyMoiveClip, AttachMovie,duplicateMovie
Last edited by feel : 2004-03-10 at 10:09.
























if i use as to create application i try to use.


ActionScript Code:
this.createEmptyMovieClip("mc",1)


then

i try to use "duplicateMovie" and "attachMovie" both not work. anyone can help

LoadMovie Together With DuplicateMovie Problem
Hello, Im trying to make my self a little dynamic photo gallery with
xml. Im just trying to make 9 thumbnails at first which is supposed
to link to a bigger picture when hit.

I have a thumbnailHolder_mc in _root. a thumbnail_mc is nested
inside which are animated. This function is supposed to duplicate
the thumbnailHolder_mc 9 times and then use loadMovie to load
the thumbnails into their thumbnail_mc. Every time I try to put the
code line which is commented, I get an error saying
Error opening URL "file:///C|/Documents%20and%20Settings/Eier/Skrivebord/xmlTest/thumbnails/undefined".

Someone see the problem here?

XML-file:
Code:

<bilder>
<bilde1 navn="nr1" liten="tnr1.jpg" stor="stor1.jpg"></bilde1>
<bilde2 navn="nr2" liten="tnr2.jpg" stor="stor2.jpg"></bilde2>
<bilde3 navn="nr3" liten="tnr3.jpg" stor="stor3.jpg"></bilde3>
<bilde4 navn="nr4" liten="tnr4.jpg" stor="stor4.jpg"></bilde4>
<bilde5 navn="nr5" liten="tnr5.jpg" stor="stor5.jpg"></bilde5>
<bilde6 navn="nr6" liten="tnr6.jpg" stor="stor6.jpg"></bilde6>
<bilde7 navn="nr7" liten="tnr7.jpg" stor="stor7.jpg"></bilde7>
<bilde8 navn="nr8" liten="tnr8.jpg" stor="stor8.jpg"></bilde8>
<bilde9 navn="nr9" liten="tnr9.jpg" stor="stor9.jpg"></bilde9>
<bilde10 navn="nr10" liten="tnr10.jpg" stor="stor10.jpg"></bilde10>
<bilde11 navn="nr11" liten="tnr11.jpg" stor="stor11.jpg"></bilde11>
<bilde12 navn="nr12" liten="tnr12.jpg" stor="stor12.jpg"></bilde12>
<bilde13 navn="nr13" liten="tnr13.jpg" stor="stor13.jpg"></bilde13>
</bilder>



xml-parsing Code:


var myXML:XML = new XML();
myXML.ignoreWhite = true;
var navn:Array = new Array();
var liten:Array = new Array();
var stor:Array = new Array();
var nr:Number;

myXML.onLoad = function(){
_root.thumbnailHolder_mc._visible = false;
var photos:Array = this.firstChild.childNodes;
for(i=0; i < photos.length; i++){
navn.push(photos[i].attributes.navn);
liten.push(photos[i].attributes.liten);
stor.push(photos[i].attributes.stor);
nr = 0;
       }
}

myXML.load("bilder.xml");



thumbnail function Code:

function synlig(){
while( ++i < 3){
var j:Number = -1;
while(++j < 3){
++k;
var name = "thumbnailHolder"+k;
_root.thumbnailHolder_mc.duplicateMovieClip(name, k);
_root[name]._x = xStart + i * xSpacing;
_root[name]._y = yStart + j * ySpacing;
_root[name].tall = k;
loadMovie(liten[k], _root[name].thumbnail_mc); //Problemo!!!
_root[name].onPress = function(){
_root.storHolder_mc.stor_mc.loadMovie(stor[this.tall],this.tall);
}
}
}
l = k;
k = 0;
i = -1;
}

DuplicateMovie() And Dynamic Inst Names
HI im trying to dupe a mc symbol in a loop.

Inside the mc symbol is a dyanimic textbox sitting on a button, which will be passed unique variable values as loaded by a txt file for each created mc. The variable names passed follow this convention below in the txt file

Code:
(namelist.txt)

&name1=joe
&name2=james
&name_count=2
etc...
To create the unique instance names for the duped mc's I use a for loop with a concatenating string, in the form: variable + index, which is fine. But in the case of the dynamic textboxes which is sitting inside each mc that is created i want to pass it unique varaibles (as loaded above) as they are created with their parent mc ( ie name1_Mc should be excepting name1 varaible for its textbox). To my understanding the textbox variable is manually set in the text boxes properties. Is there anyway to do this dynamically as I create the mc's?

Anyway this is what I have so far (below) where im using a generic varaible in textboxes (would this work?)


Code:
for(int i = 0; i < name_count; i++)
{
//dupe clip and give unique 'incrementing' instance name
name_Mc.duplicateMovieClip("namebox" + i + "_Mc", _root.namegroup_Mc);

//label this....send loaded varaible to generic txt box
//varaible name 'name'
_root.playlist_Mc.("namebox" + i + "_Mc").name = ("name"+i);
}

Copyright © 2005-08 www.BigResource.com, All rights reserved