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








Attach Dynamic MovieClip


Hi all,
Im pretty new to this forum so.. first post

I wanted to attach movieclip(btn_select) from my library to the stage (movieclip:container) by XML so here's my code..

here's my loading of xml...
Note: portXML.childNodes[0].childNodes.length; is 3

portXML.onLoad = function(success) {
loadFunct();
TotalNumPort = portXML.childNodes[0].childNodes.length;
trace(TotalNumPort)

//trace(portXML.childNodes[0].childNodes.length);
};

and here's my other code to attach movieclip...

function loadFunct() {
for (i = 0; i<TotalNumPort; i++) {
container.attachMovie("btn_select", "btn_select" + i, container.getNextHighestDepth()*i, {_x:50*i, _y:100});
}
textDisplay.text = portXML.childNodes[0].childNodes[0].childNodes[2].childNodes.toString();
}

Thanks for any help given




KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 05-12-2008, 11:20 PM


View Complete Forum Thread with Replies

Sponsored Links:

Attach A Dynamic MovieClip To Another MC
Hello

I am dowloading images using the MovieClipLoader. no problem. the images are going in to a movie clips.
But how do I insert those images to another movie clip. This MC should do some animation using the images (like fading..)

attachMovie is working only with MC in the libary!

What can i do?

adi

View Replies !    View Related
Attach Dynamic Movieclip To Scrollpane MX2004
Hi,
How do you attach multiple movie clip to a scrollpane.
I did the following but it doesn't seem to work

1. create an empty movieclip
2. attached multiple movie clip from the library into the previously created empty movie clip
3. set the contenPath of the scrollpane to pint to the empty movie clip (from step 1)

OUTPUT.
movie clip will show up outside the scrollpane.

Did I do smething wrong ?

Thanks:-)

View Replies !    View Related
On HitTest To A Movieclip(a) By Movieclip(b)i Want To Attach Another Movieclip(c) To
on hitTest to a movieclip(a) by movieclip(b)i want to attach another movieclip(c) to movieclip(b)which is in the stage,so how to do it??
can anybody help on this???

View Replies !    View Related
Remove Movieclip, Then Attach Another Movieclip
I'm attaching a few MC's one at a time depending which one is being called on by clicking of a button. After I have attached an MC and i want to go to another MC, I want to remove the MC at the end of some animation inside that MC; then I want to attach a new MC. Everything works except when I want to attach the new MC.

Here's my code, please let me know what I'm doing wrong.


Code:
btn_i.onRelease = function() {
if (newMC._currentframe == newMC.totalframes) {
newMC.removeMovieClip();
attachMovie("interact", "newMC2",1,{_x:340,_y:250});
}else {
newMC.nextFrame();
newMC.play();
}
Thank you so much!

View Replies !    View Related
Attach Movieclip To Empty Movieclip
Hello, i try to attach a mc to an empty mc, here is the code:


Code:
this.createEmptyMovieClip('bgs', 'bgs', '10100');
bgs.attachMovie('bgtile1', 'bgtile1', '10102');
bgs.bgtile1._x = '25';
bgs.bgtile1._y = '163';
This do nothing whereas the following one works :

Code:
attachMovie('bgtile1', 'bgtile1', '10102');
bgtile1._x = '25';
bgtile1._y = '163';
I don't understand why the first one doesn't work..help is welcome

View Replies !    View Related
[F8] Attach Movieclip To Empty Movieclip
I know this is really easy, but I cant get this one to work. I have an empty movieclip on the stage with instance name "container". I want when the user clicks the button for it to put a movieclip "one" from the library inside container, what am i missing, here is what I've tried.

on(release){
container.attachMovie("one");
}

But this doesn't work. I also would like it to fade in when it attaches, can I have it do that as well?

Thanks for any help. I know this has to be super easy.

View Replies !    View Related
Attach Movieclip And Remove Movieclip
i can i attach a movieclip from the library and later remove it?

View Replies !    View Related
[F8] Attach Movieclip Help
hi there im back again and need a little more help hope someone can help again lol. heres my problem, dragging a movie clip onto the stage and adding action script to it is simple enough but what if i have it so i use attachMovie to put the movie clip onto the stage?? how can i have it so that the movie clip has actions on it and give it an instance name??

hope someone can help wondering if this is possible

View Replies !    View Related
Movieclip... Attach
Problem: Cannot get the following code to attach a single instance of a movie clip (for now) whos linkage name is "test_mc" (the same as its name in the library) to attach to the stage with the movement code onto it. I have the "export for actionscript" checked in linkages along with "export in first frame".



Code:
for (i=1; i<1; i++) {
_root.attachMovie("test_mc", "testPLACED_mc"+i, i);
_root["testPLACED_mc"+i].onEnterFrame = function() {
with (["_root.testPLACED_mc"]+i) {
//stuff pertaining to movement goes here
}
//end with
};
//end function
}
//end for loop
no movie clip appears and I get this error:
**Error** Symbol=test_mc, layer=Layer 1, frame=1:Line 1: The class or interface 'test_mc' could not be loaded.

please help in anyway you can. I posted this earlier this week but noone was able to help so I am posting it again. I have struggled with this for days. And to make matters even WORSE I can only get flash to recognize and execute commands in response to my arrow keys and not the keyboard, even though I am using the same code and correct keycode.. arg!

the attached file here is the test .fla for this actionscript.

View Replies !    View Related
Attach MovieClip.
Hello,

I have two menus. Several Buttons have the same names. Is there a way to use the same function to add EventListeners? When I add this I get following error: A conflict exists with definition myObject in namespace internal.


HTML Code:
function AttachObjectF(type:Number){
if(type==1){
var myObject:FirstMenu=new FirstMenu();
}else if(type==2){
var myObject:SecondMenu=new SecondMenu();
}
addChild(myObject);
myObject.Button1.addEventListener(MouseEvent.CLICK, Button1F);
}

View Replies !    View Related
Help With (attach.movieclip) Problem
hello flashers,

This is the website that i got it from: http://www.eviltwin.co.uk/devlab/windowsize/index.html

here is what i have?
On frame 1 i have some codeing like this...


Code:
depthStart = 1000;
posX = 50;
posY = 50;
count = 1;

function spawnWindow(){
++depthStart;
_root.attachMovie("window","win"+count,depthStart);
_root["win"+count]._visible = false;
_root["win"+count]._x = posX;
_root["win"+count]._y = posY;
_root["win"+count].killstage = 4;
_root["win"+count].spawnme = true;
posX += 20;
posY += 20;
++count;
}

spawnWindow();
stop();
the "window" is the linkage name.

and i also have a button which has


Code:
on(release){
_root.spawnWindow();
}
My problem is to change this codeing, so that
when it is open (the window). When you click
on the button it closes it. And click on the
button again it opens.

Does anyone know how to do this?

- thanks, William

View Replies !    View Related
Attach Actionscript To Movieclip
Hi!
I want to attach this scrip to a movieclip creatad with duplicateMovieClip or attachMovieClip. Since I want all of the movieclips to disapear at 101pixels I cant attach it to a movieclip and duplicate it. Then the original won't disapear


onClipEvent (load) {
_root.counter.n++;
this._x=0;
this._y=100;
nummer=_root.counter.n;
}
onClipEvent (enterFrame) {
this._x++;
if (this._x>100) {
this.duplicateMovieClip(ball+_root.counter.n,root. counter.n);
this.removeMovieClip();
this._x=0;
this._y=100+10*_root.counter.n;
}
}


The above works fine exept for the original MC... still on the screen... please help!

View Replies !    View Related
Attach AS To Movieclip Asap
I used CreateEmptyMovieClip and loadMovie to create a new Movie. Now I would like to attach some code to this movie for ex. a onClipEvent(onRelease)-function. Anyone can help me? Thanx in advance!

View Replies !    View Related
Attach Movieclip Question...
Hi...all

I've tried to make attach movieclip and it's work fine......but I want to go a bit further about this topic but I stuck for long time and couldn't find the way to sort it out....please help!

Here the story

1. One stage has only 1 mc (for attach movieclip)
2. I made attach movieclip to my buttons (each button will attach a different movieclip)
3. They all done fine......but I don't know how to do like this....
4. When I click another button to attach the new movieclip, I want my current movieclip play until the end of frame (I put stop action at the middle of movieclip) Then the new movieclip will start to play....make sense?

I also attach my example for you guys to check it out, might be you can understand it clearly....

Sorry about bad English and hope you can help.

Cheers

View Replies !    View Related
Working With Attach MovieClip
I have a mc(subNav) that I want to attach. I have been able to do this with a for loop and attachMovie, and then place each to a certain point below the previous. I am having problems assing the text to the textbox in each and assign an onClipEvent to each.

View Replies !    View Related
How Do I Attach A MovieClip To MainTimeline?
I posted a problem before about attching a movie clip. I can make it work when I put this code on a Movie clip that is on main stage.

onClipEvent(load){
attachMovie("Ball","NewBall",0)}

and it puts the ball in that movieclip.
But I don't want that. I want to be able to attach a movie clip to the main stage when the movie loads. I think I need to put the code in the first frame of the Main timeline, but when I try putting this code there, it doesn't work. What am I missing? I tried using _root.attachmovie(...)but that didn't work. Please if anyone could help, I would appreciate it.

View Replies !    View Related
Help To Attach A Scrollbar To My Movieclip
i just couldn't set my scrollbar to scroll properly accordingly to my movieclip.

Basically is when the user clip on the pointer,(unit1) it will collaspe to show its content. How this is done is i set the visible of the unit's content true or false. Thus expand the overall height of the moveclip and thus affect the scrolling pattern of my scrollbar.

View Replies !    View Related
Attach Movieclip On Click
Hello,

I want to mark a spot on a map when it is clicked on.
What would be the best way for me to make this happen?
I don't need specific code. I just want logic.

Basically I want a movieclip to appear wherever the user clicks on the map.
Simple enough ay?

Please help, I appreciate it.

View Replies !    View Related
Attach Movieclip From Array
i have three movieclips in library, with the following linkage:
mc01
mc02
mc03

How can i put these in an array, and use a for loop to attach these movieclips to the stage where Y position increases?

View Replies !    View Related
Attach Movieclip To Netstream
Can I attach a movieclip to a netStream? I have a movieclip that does things dynamically and I want that to stream live to everyone. Can I use attachNetStream and attach the movie clip?

View Replies !    View Related
Attach MovieClip ABOVE Other Layers?
Hi there,

I put the actionscript code on the top layer on its own, and yet it still doesnt work.

I want my MC to attach above all of the other layers with content, which are in the same MC.

Here is my code.


Code:
var loadmc:cmyk_y=new cmyk_y();
loadmc.x= -128.3;
loadmc.y= 92.7;
addChild(loadmc);
Is there a way to bring it to the front?

Many thanks

View Replies !    View Related
Attach Variable To Movieclip
I am stuck...
I get an array of data from a xml-file. From that XML-file I will send data to movieclips - in each movie clip I have a textfiled - to that I can easily send the data - but I would also like to store daya in the variable "namn" that I would like to use later -

I tried this in a array:

ActionScript Code:
sokvagen.skriv = arrImgXML02[item].namn;

But I did not work. Ideas?

View Replies !    View Related
Unload An Attach Movieclip
this is the code I place on the main time line button to load the movieclip

on (release) {

this.attachMovie("mcInfoElem","myElem",1);
myElem._x = 320;
myElem._y = 185;

this.myElem.onPress = function (){
startDrag("_root.myElem");
}

this.myElem.onRelease = function (){
stopDrag();
}

myElem.btnClose_mcInfoElem.onRelease = function () {
unloadMovie("_root.myElem");
}
}

but in the end the loaded movieclip can be drag but cannot close

this one I place the script main timeline

_root.btnElem1.onRelease = function(){
/*fl_ElemID = 1;
_root.placeHolder.attachMovie("mcInfoElem","myElem ",1);
placeHolder.myElem._x = 100;
placeHolder.myElem._y = 50;*/

placeHolder.attachMovie("mcInfoElem","myElem",1);
myElem._x = 320;
myElem._y = 185;

}

_root.myElem.onPress = function (){
startDrag("_root.myElem");
}

_root.myElem.onRelease = function (){
stopDrag();
}

but in the end, it can be close via the loaded movieclip button, but cannot be drag.

Is it really the parents -child thing?
I don't really understand
If so is the parents child problem,
how should I loaded a movie clip and can unloaded the movie clip by clicking the button on the loaded movie clip?
Serious and urgent help needed, thank you so much.

View Replies !    View Related
Attach Movieclip Problems
lets say I have a johnny_appleseed_mc and I make some seeds that over a series of events will grow into apple trees.

the seed_mc is located in my library, and I am loading it like this:


if(Key.isDown(Key.SPACE)){
this.createEmptyMovieClip("holder" , "100");
holder.attachMovie("seed_mc", "tree_mc", holder.getNextHighestDepth(), {_x:johnny_appleseed_mc._x, _y:johnny_appleseed_mc._y -50});
holder.x=johnny_appleseed_mc._x;
holder.y=johnny_appleseed_mc._y;
}


when i movie the johnny MC, the seed_mc doesn't follow (good), but when I plant again (another seed) the original seed_mc in the first position disappears and reappears in the new position of johnny, as if the first seed was never planted. How do I make the old seeds stick in place, and still plant new seeds?
(edited for clarity)

View Replies !    View Related
Attach A Variable To A Movieclip
hello,

i want to duplicate an MC and to each duplicated MC, attach a variable "counter" which will increment as movie runs.

problem is i'm confused on how to do it. I thought this would work , but apparently it does not :

PHP Code:



var newClip:MovieClip = _level0.animation.myPen.duplicateMovieClip(penMC, _root.mainCounter);newClip._alpha = 50;newClip.counter = 0;for (i=0; i<_root.mainCounter; i++) {penMC2 = "myPen"+i;        _level0.animation[penMC2].counter++;if (_level0.animation[penMC2].counter>_root.alphaCounterEndValue) {            var my_color:Color = new Color(_level0.animation[penMC2]);            my_color.setRGB(0xEEEEEE);            _level0.animation[penMC2]._alpha = 100;        }        if (_root.alphaCounterStartValue<=_level0.animation[penMC2].counter<=_root.alphaCounterEndValue) {            _level0.animation[penMC2]._alpha--;        } 




this code is probably messy, i'm from Flash5 and flash MX coding is really confusing to me

View Replies !    View Related
How Do I Attach Another Movieclip Without Affecting The First?
Hi,

How can i attach another instance of the movieclip from the library, without causing the first one to disappear? Please take a look at my fla. I think the relavant actionscript are inside a dummy movieclip in newblock_mc which is inside the library. Currently, when we start the game, one block will be created and fall, and stop when it reaches the bottom of the screen. How do I create another block whenever a block reaches the bottom of the screen? In such a way that i still can move the newly created block left and right, without also moving the other block(the one that is at the bottom on the screen) too?

Thanks in advance.

PS. I can't attach my fla here, sorry. Limit is 74kb and mine is 324kb. I can email it to you.

View Replies !    View Related
Attach Movieclip ... How To Clear It Out?
i'm making my own combo box based on an array that can change based on a user input variable. i need to find a way to update the dynamically attached mc's based on when that array changes. that or to use a button (as i'm currently using to trigger it) to clear out the clips i'm attaching and attach a new number of clips for the updated(new) array.

here's what i have:


Code:
stop();
var columnsb=1;
var list_spacingb = 20;

var years_array= ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13"];

loanButton.onRollOver=function(){

if (PurchasePrice != undefined){
//tried to use removeMovieClip without success!
attachClip.removeMovieClip("termClip"+i);


if(PurchasePrice > 0 && PurchasePrice <= 10000){
displayArray = years_array.slice(0,6);
}
if(PurchasePrice >=10000 && PurchasePrice <= 15000){
displayArray = years_array.slice(0,10);
}
if(PurchasePrice >=15000 && PurchasePrice <=25000){
displayArray = years_array.slice(0,12);
}
trace(displayArray);
buildMenu(displayArray);
}
}

buildMenu=function(displayArray){
trace(displayArray);
arrayLength=displayArray.length;
for(i=0; i<arrayLength; i++){
item=attachClip.attachMovie("termClip", "termClip"+i, i);
item.index=i;
item._x = (i%columnsb)*list_spacingb;
item._y = Math.floor(i/columnsb)*list_spacingb;
item.termYears=displayArray[i]+" years";
}
item.termButton.onRelease=function(){
var id = this._parent.index;
varsHolder.term=displayArray(id);
loanTerm=displayArray(id);
}
displayArray="";



}
i should clarify that it's working, but i need the attached clips to reset each time the function occurs because sometimes there'll be less clips attached if the array length is less and right now if the array length is twelve and then it gets changed to 6, there are still 12 clips attached! (make sense?)

View Replies !    View Related
Anyone Know How To Attach A Movieclip Without It Being Visible...?
When I attach a movieclip I scale it almost immediately to the right size but there's always a flicker as the clip appears at full size before it gets a chance to be scaled down... I scale literally right after the call to attachMovie... any ideas?

View Replies !    View Related
Attach And Remove Movieclip
Hi all and thanks 4 a great forum

Iīve got a problem that is really bugging me. Iīve got a function "addNavSquare" which works fine. it attaches a moveclip to the root and the number of clips is controlled by a .xml file. The movieclips works as an "index" to show different images. it all works fine.....

function addNavSquare() {
for (var i = 0; i<total; i++) {
menuName = "menuSquare_"+String(menuCount);
menuDepth = this.getNextHighestDepth();
this.attachMovie("navigation_box",menuName,menuDep th,initMenuButton);
this[menuName]._number = menuCount;
this[menuName]._x = 210 + menuCount * 15 ;
this[menuName]._y = 120;
menuCount++;
}
}

But !

when i try to remove the movieclips using the code below it wont work !?

function removeNavSquare() {
trace ("deleted");
for(var i = 0; i < menuCount; i++) {
this["menuSquare_"+i].removeMovieClip();
}
}

Í would be really greatful for any good tips or ideas !

Thanksalot Johan

View Replies !    View Related
Xml Attributes , Attach To Movieclip
hi i've not used flash for a long time.

i've been using the flash tutorials on here to create an image scroller that has the data read in by xml.

the problem i'm having is attaching an attribute to the url of a movieclip.
i can't figure out how to attach it to the movieclip.

flash files is just over the upload limit so here is the code


Code:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
link = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
thumbnails[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
thumbnails[i].strURL.push = xmlNode.childNodes[i].childNodes[2].attributes.url;
trace (thumbnails[i].attributes.url); //this returns undefined
is i trace the line above i get all the values out of that attributes
thumbnails_fn(i);


}

} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");

function thumbNailScroller() {

// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function() {

if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {

if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {

thumbnail_mc._x -= scroll_speed;

} else if ((_root._xmouse<=40) && (thumbnail_mc.hitTest(hit_left))) {

thumbnail_mc._x += scroll_speed;

}

} else {

delete tscroller.onEnterFrame;

}

};

}




function thumbnails_fn(k) {

thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(eval("thumbnail_mc.t"+k)._width+5)*k;
target_mc.pictureValue = k;
target_mc.link = k
//this is where i want to attach the link to the movieclips please help!
target_mc.onRelease = function() {


/*p = this.pictureValue-1;
nextImage();*/

};
target_mc.onRollOver = function() {

this._alpha = 50;
thumbNailScroller();

};
target_mc.onRollOut = function() {

this._alpha = 100;

};

};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);

}

View Replies !    View Related
Attach A Variable To A Movieclip
hello,

i want to duplicate an MC and to each duplicated MC, attach a variable "counter" which will increment as movie runs.

problem is i'm confused on how to do it. I thought this would work , but apparently it does not :

PHP Code:



var newClip:MovieClip = _level0.animation.myPen.duplicateMovieClip(penMC, _root.mainCounter);newClip._alpha = 50;newClip.counter = 0;for (i=0; i<_root.mainCounter; i++) {penMC2 = "myPen"+i;        _level0.animation[penMC2].counter++;if (_level0.animation[penMC2].counter>_root.alphaCounterEndValue) {            var my_color:Color = new Color(_level0.animation[penMC2]);            my_color.setRGB(0xEEEEEE);            _level0.animation[penMC2]._alpha = 100;        }        if (_root.alphaCounterStartValue<=_level0.animation[penMC2].counter<=_root.alphaCounterEndValue) {            _level0.animation[penMC2]._alpha--;        } 




this code is probably messy, i'm from Flash5 and flash MX coding is really confusing to me

View Replies !    View Related
Attach Movieclip Targeting
I've created some attached movieclips and soon as I place them on the stage I want to target them and have them each be parameters in a function...an enterFrame function....but the function needs to have random action in it so I have to make sure every star passed isn't having the same randomNum generated for it's movement. For this example I just used the variable myRandom.


ActionScript Code:
var amount = 10;
var idx:Number = 10;
function getStars() {
    for (var i = 0; i<=amount; i++) {
        var myRandom:Number = randRange(5, 200);
        var star = this.attachMovie("starmc", "star"+idx, idx);
        star._x = myRandom;
        star._y = starmc._y;
        this.onEnterFrame = function() {
            star._alpha -= myRandom;
        };
        idx++;
    }
}
getStars();
//this.onEnterFrame = getStars;
function randRange(min:Number, max:Number):Number {
    var randomNum:Number = Math.floor(Math.random()*(max-min+1))+min;
    return randomNum;
}

View Replies !    View Related
Attach Random Movieclip?
Hi.

Say I have four different movieclips. "Car1", "Car2", "Car3" and "Car4".
Now I have an empty mc that I want these fifferent movie clips attached to on an (enterFrame) handler. How can I do it? Believe me, I have tried! I have never used the word "random" before yesterday. I get the "Car"-mcīs to change colors randomly every time they start, but...Please try and help me become a Flash princess...Please...

View Replies !    View Related
Attach Movieclip In Layer?
How do I attach the movieclip to a certain layer in the main movie timeline? Now it occurs on the top of everything.

Best regards/

Sune

View Replies !    View Related
Attach MovieClip To Empty Movie
Hi..

I have an empty movie clip called emptyMC which I have
placed in a set place on the stage.

I want a movie clip called openupMC to appear where the
empty movie clip has been placed.

I am struggling with the correct ActionScript


Code:
on (release) {
emptyMC.attachMovie("openupMC", "openupMC",1);
}
Please can some body help with correct script.

Cheers mave

View Replies !    View Related
Flip An Image On Attach Movieclip?
I'm attaching a movieclip to the stage and then setting certain variables to create a rondom feel. I want flash to randomly select NORMAL or MIRRORED. The effect is just a horizontal flip of the original movieclip. I know this is easy for someone, please help.

View Replies !    View Related
How To Loadmovie And Attach A Certain Movieclip From Itīs Library
Hi!
I have a problem that I havenīt been able to solve.
From a button in a main movie:
How do you tell a loaded movie to attach a certain movieclip "attachmovieclip" from itīs library. Itīs seams that the loaded movie has to be completly loaded before it can "remember" which attached movieclip it should attach.
I would be very thankful for comments.

/sune

View Replies !    View Related
Attach Class Inside A MovieClip
hi,
i have created 2 classes 1.LoaderPane, 2.Annotation. in actionscript.
in LoaderPane there is another movieClip name __imageClip which is used to display image in it.
i want to attach the Annotation class inside this __imageClip. but the code is not working. if i attach the Annotation class inside the LoaderPane then it works fine. but i want it to be attached inside LoaderPane.__imageClip.

function someFunctionInsideLoaderPane():Void{
var i = __annotationCount;
var ann = this.attachMovie("Annotation","annotation"+i,this. getNextHighestDepth());
ann.DrawRectangle(x1,y1,x2,y2,i);
__annotationCount++;
}

Faraz

View Replies !    View Related
Minor Problem With Attach MovieClip
Hi,

So this is my problem:

I have a main movie which has a MC with linkage name "mc1" in the library.

The main movie loads another movie called child.swf into an empty movieclip on the stage.

The child.swf has an empty movieclip and a button.

When I click the button, it has to attach the movieclip which is in the main.swf's library ,with linkage name "mc1".

But I'm not able to get this working.

It does work if I have the "mc1" even in the child.swf, but I don't want it like this.

The whole idea behind this is for my project, which involved usage of skins for which would change in the future. So I want to have them in the base file itself, to facilitate this functionality.

But I'm facing this problem and unable to move forward..


Any help guys....

And I need this to be done soon...Guys help me out.

View Replies !    View Related
Attach Unique MovieClip From A For Loop
Hello, I am trying to attach different movieClips at runtime all within a for loop. I am running into trouble with the movie not getting attached. But, if I change the movie name that needs to attached to something solid like: "trail1" it works fine ..as apposed to: "trail"+i

Any thoughts out there?

Here the code so far:

function checkState(ID) {
if (ID.clicked == false) {
ID.gotoAndStop(2);
} else if (ID.clicked == true) {
ID.gotoAndStop(1);
}
}
for (i=1; i<11; i++) {
var trailName:String = "trail"+i;
_root['trail'+i].onPress = function() {
_root.attachMovie(trailName, "trail", 1, {_x:214, _y:136});
checkState(this);
};

}

View Replies !    View Related
Attach Class Inside A MovieClip
hi,
i have created 2 classes 1.LoaderPane, 2.Annotation. in actionscript.
in LoaderPane there is another movieClip name __imageClip which is used to display image in it.
i want to attach the Annotation class inside this __imageClip. but the code is not working. if i attach the Annotation class inside the LoaderPane then it works fine. but i want it to be attached inside LoaderPane.__imageClip.

function someFunctionInsideLoaderPane():Void{
var i = __annotationCount;
var ann = this.attachMovie("Annotation","annotation"+i,this. getNextHighestDepth());
ann.DrawRectangle(x1,y1,x2,y2,i);
__annotationCount++;
}

Faraz

View Replies !    View Related
Attach A Movieclip To A Specific Frame?
Is it possible to attach a movieclip to a specific frame? If so how do you do it?

Thanks.

View Replies !    View Related
How To Use Classes To Create/attach Movieclip?
Hi,

I m new to Flash. I need to develop Flash application for mobile devices.
I have created a class and using that class i created a movieclip.

I have created one more class. And whenever the enter key of the mobile device is pressed i need to create a movie clip using the second class.
How to do this?

this.attachMovie("PieChart_mc", "pie_chart"+vPieChartDepth_num+"_mc", vPieChartDepth_num, vPieChartProperties_obj);
var vThisPieChart_mc= this["pie_chart"+vPieChartDepth_num+"_mc"];

keyListener.onKeyDown = function() {

switch (Key.getCode()) {
case Key.UP :
vThisPieChart_mc.highlightPreviousWedge();
break;
case Key.DOWN :
vThisPieChart_mc.highlightNextWedge();
break;
case Key.LEFT :
vThisPieChart_mc.highlightPreviousWedge();
break;
case Key.RIGHT :
vThisPieChart_mc.highlightNextWedge();
break;
case Key.ENTER :
vThisPieChart_mc.removeMovieClip();

var newDepthNumber:Number;
newDepthNumber = vPieChartDepth_num + 1;
trace("New depth Number : " + newDepthNumber);

this.attachMovie("Displaydetails_mc", "display_details"+newDepthNumber+"_mc", 1);
var vDisplaydetails_mc= this["display_details"+newDepthNumber+"_mc"];
trace(vDisplaydetails_mc);
//// This trace gives the result as 'Undefined'

default :


break;
}
};




I dont know what's the problem? I want to remove or unload the previous movie(Which shows a piechart) and to load another movie(which shows details in a table).

Can anyone please help me?

Thankfully,
jmukunth

View Replies !    View Related
Attach Extra Data To MovieClip?
Hi,

Is it possible to attach some extra value/variable to movieclip?
for example, my_mc._somedata = "1"; // it would be integers between 0-xxxx

What I'm trying to do with that:
When you click movieclip, it sets selectedIndex in a list component.
(That list index_number would be "saved" on the movieclip, so I dont need search 'for...next' the whole list everytime movieClip is clicked..)

*edit: Ok works now, I dont need to add extra values, I just set 'onClick' to select the correct index for every movieclip.

View Replies !    View Related
Attach A MovieClip Dynamicly Create ?
Is it possible to attach a movieClip dynamicly create ?
With attachMovie and ObjectRegisterClass ?
In this exemple below, duplicate the mc1 IN mc2

_root.createEmptyMovieClip('mc1', 1);
mc1.beginFill(0, 100);
mc1.lineTo(50, 0);
mc1.lineTo(50, 50);
mc1.lineTo(0, 50);
mc1.endFill();
//
_root.createEmptyMovieClip('mc2', 5);
mc2._x = 200

// code ?

mc2.attachMovie('mc1','mc3',10);

Thanks !

View Replies !    View Related
Attach A MovieClip To A Window Component
Hi Guys,

I'm trying to attach my MovieClip 'Test' to my Window Component 'aboutusWindow'. However no matter how many variations I try or values I tweak nothing seems to work.

The Windows is created by the code and destroyed by the code, I was wondering if anybody could help me.

Thank you.

- Anthony

View Replies !    View Related
[F8] Attach Movieclip In Same Place On Button Press. HELP
Hello.

I am creating a game with alot of minigames. In the minigame I am currently creating, I am doing a "Spot 6 differences" question.

I have 2 pictures on stage and on the second picture I have 6 buttons on the picture which are differences because something is added to the picture.

Example:
Picture 1: there is 1 cloud
Picture 2: there are 2 clouds

The second cloud that was added is a button for the player to click on because it is a difference. Get it?

Anyways, I have 6 buttons, the instance names for these 6 buttons are "diff1", "diff2", "diff3", "diff4", "diff5", and "diff6".

When the player clicks a difference, I want it so that it gets circled so I have the exact same button in the library except it has a circle around it. The names of these movieclips are "diff1_2", "diff2_2", "diff3_2", "diff4_2", "diff5_2", and "diff6_2".

I want it so that when the person clicks the button it attaches a movieclip it it's exact spot.

Example:
There is a button on stage - instance name: "diff1".
The player clicks "diff1".
"diff1_2" is attached to the main stage exactly where "diff1" was/is.

The same thing should happen for the other buttons ("diff2", "diff3"... "diff6").

Another thing that I need is that when all 6 buttons have been replaced with the movieclips, (they all have circles around them) then it should move to another scene.

Please help me with this issue.

Early thanks to whoever replies.

View Replies !    View Related
Target Button Inside (attach) Movieclip
Hi everyone,
im trying to get a button working that is inside a movie clip.

the movieclip is given a linkage identifier (container_id and name as container_mc) as it is inside the library and not on the stage.

The movie clip has three buttons inside it.

I have the following code on each of the button

Code:
_root.containerBase_mc.scrollUp_btn.onRelease = function() {
trace("scrol upn");
};

this.containerBase_mc.scrollDown_btn.onRelease = function() {
trace("scrol down");

};
this._parent.containerBase_mc.close_btn.onRelease = function():Void{
trace("close me");
}
as you can see my desperate attempts to get this working

none of the trace actions work...
any help?

thank you.

View Replies !    View Related
Problems To Attach A Movie Inside Of Other Movieclip
Hello,

I'm trying to create some movie clips inside other ones but none of attachmovie or load movie seems to work for me when using it inside a movie clip.

Basically what i'm trying to do is create a gallery of images as part of the main flash movie. And the gallery is an object that has to contain serveral objects of the type photogallery

The code i use to create the gallery in the scene is

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

ActionScript Code:
_root.attachMovie("Gallery", "Gallery1",2);
Gallery1.LoadGallery();
---------------------------------------------------------

and it works pretty well, but when trying to do the same in the function of the "LoadGallery" in the class gallery with the code

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

ActionScript Code:
cGallery.prototype.LoadGallery=function(){
        this.attachMovie("PhotoGallery", "PhotoGallery1",2);
}
-----------------------------------------------------------------

none instance of the class PhotoGallery attach to the gallery. I have debbuged it and it enters in the function Load Gallery. I don't know what i'm doing wrong. Can any one help me. I'm very confused.

Thanks in advance.


pd: Sorry for my english if it's not good enough

View Replies !    View Related
Attach Movie Clip To Another Movieclip (both Are In Library)
Is it possible to attach a movie clip to another moviecilp on the library using attachMovie () method
(on the fly).
Actually i want this for use the scrollPane component in flash mx. If it is possible the dynamically
populated movie clip having a scroll bar without using a customed scrollbar.

I've manually added a scollbar for the populated movieclip but that is not working.

View Replies !    View Related
Attach Movie Clip To Another Movieclip (both Are In Library)
Is it possible to attach a movie clip to another moviecilp on the library using attachMovie () method
(on the fly).
Actually i want this for use the scrollPane component in flash mx. If it is possible the dynamically
populated movie clip having a scroll bar without using a customed scrollbar.

I've manually added a scollbar for the populated movieclip but that is not working.

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