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




Create Circle Inside External .as File



I have an external .as file which generates a whole bunch of lines randomly and i need some help in creating a circle and attaching the circle to the X,Y position of the line which im calling through a loop.i know the loop works as i get the X,Y coords so thats working perfectlyall thats left is to create a function that draws a circle so that i can attach it to the x,y coords. if (cheese < 10){ cheese = cheese+1; }else{ trace("x"); trace("y"); cheese = 0; }
Code:
public function drawDot():Void { trace('dot magically appears on stage'); }
I have never dealt with external .as files like this before and im stumped as how to go abouts creating a function that i can call in the loop.Any help is appreciated and excuse the crappy explanation.Cheers



SitePoint > Design Your Site > Flash and Actionscript
Posted on: Oct 25, 2006, 13:16


View Complete Forum Thread with Replies

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

How To Create A Printable Form Inside A Swf File
I would like to create several dynamic/input text fields and then have a button to create a quote based on the info in the fields. Then the final step is to give the user the ability to print a report/form based on the quote.

Any suggestions?

Thanks

Jim

Create External Txt File From Flash Cs3
Hi all, i'm currently working on a flash movie and it will be run from a CD i want it to be able to take the contents of a text box and save it as a txt file on the users desktop. Can anyone tell me if it's possible?

Any help anyone can offer would be greatly appreciated.

Can Flash Create An External Text File?
can flash create an external text file which consist variables from inside swf?

thanks,
cid

If Mc Is Inside Circle..
Hey all,

i havent posted in fk for years so hey remember me?

Ive never had any problems with flash as i always manage to find a work around to almost anything, but now ive hit a brick wall.

for my latest game im creating i need to detect whether an mc's x and y is within range of a circle mc,

You could call me a n00b or whatever, but i've used mx and all the latest, but my preference has always been flash 5, so my latest game uses that program.

I have the circle;

_root.circle and an mc, _root.box

the box moves across the screen right to left, and i need to perform a trace such as

if(box is in circle){
trace("here");
}

the problem is that flash treats the circle as a square due to the mc side of it. I tried hittest with multiple mcs on the circle at each angle, but it lags up, and i have also tried getting the circle corner points, creating a sort of hittest 'diamond', but that too is not accurate,

I have search both google and these forums, but alas, no result.

could anyone help me here to tell when the box center-point is within the circle?

Any help is greatly appreciated

Thanks

Karl (jagopth)

edit :- If you can help me out i'll give you a mention in my game ^_^

Opening An External Help File From Inside Flash
I'm trying to create a swf file that has a button that when clicked opens a help file (saved as help.hlp). I've tryed to use the fscommand:

on (release) {
fscommand ("exec", "help.hlp");
}

but when clicked it does nothing. I've also tryed to use the getURL command and that doesnt work either. Any suggestions?

Help ....load An External .avi File Inside Flash
Is there a way to load an external .avi file inside of a flash projector.
im making a cd-rom using MX04
i know you can load external .jpg
i would appreciate it if anyone could help.
thanks

Access A Component Inside External Swf File
Hi, I loaded a external swf file that it is a dialog.

var swfLoader : Loader = new Loader();
var swfURL : URLRequest = new URLRequest("dialog.swf");

swfLoader.load(swfURL);
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,imgLoaded);

function imgLoaded(event:Event):void
{
var movie : * = swfLoader.content;
var clip : MovieClip = movie;

parent.addChild(clip);
}

Now, inside the movieClip there is a TextField component named message that i want to change its 'text' property.
The question is: How can i access to this property to change it?

Regards

How Do You Create Bullet Points In An External Text File?
How do you get bullet points to appear in an external text file in Flash MX? I am using a scrollbar component and standard html tags I place in the file are just being displayed.

Plotting Mc Inside Of A Circle
What I'm trying to do is attach a bunch of movieclips onto my game table in a grid like pattern. But the game table is a circle. So I want to cut out all of the coordinates that are not inside the circle. I could sit there and map out all of these possible coordinates my self, but I'd rather have my actionscript do it dynamically. Anyone have a good idea on how to do this?

Converting Flash Scripts Inside .fla Into External .as File?
Hi, I have a client that for some reason they are wanting to convert their .fla project and break up the 8 script layers of their game, and put it in an external .as file for the Flash project.

I was just wondering if this could be done could someone show me a link, tutorial or anything on how I would go about doing this, and why this needs to be done this way?

Easy implementation for future games of the same kind?

Calling A Frame Lable Inside Of An External File
hello.

I have created a music player. you can see it if u check out the site.

http://www.boogyoogy.com

i have this script on the first frame of the website. and when the website loads it loads the dancer1.swf in side of a MC called
"load-dancers"

loadMovie("dancer1.swf",_root.load_dancers);

you can see the dancer dancing.

inside of a dancer1.swf i have MC and inside of that MC there is a framelable called "edgarhide"

when i press on stop it should jump to "edgarhide" where the dancer wil disapiar.

i was told to try this code
on (press) {
gotoAndPlay(_root.load_dancers.dancer1.dancer("edgarhide"));
}

some one please help.

thank you

Vahe

Create A Circular Rotating Circle
Hi all,
Firstly I am a complete Noob to macromedia flash (now adobe it seems)
and desperate to finish this work for a meeting tomorrow morning. I
have a small task of creating a flash movie with the below
characteristics:

1) Shows an elipse divided into 5 quadrants each containing text
representing a business area i.e Environemental, Health & Safety.


2) On start, the elipse rotates (around the centre of its origin) for 5 seconds, stops the right way up (All the text right way up).


3) One of the business area quadrants expands, hiding the circle and
showing some more information on the business area in a box.


I started this work thinking that I could simply create the image with
Flash Pro 8 (trial version), use the INSERT --> TIMELINE EFFECTS -->
EFFECTS options to find a rotation effect but that does not seem to be
the case and after about a day's worth of research, it seems that only
actionscripting can help.


I desperately require advise, (possibly code) on how I can go about
tackling this task. Please help.

Khurram

How To Constrain Animation To Inside Of A Circle?
I am pretty sure there is a tutorial on this, but I can't find it.

I have some balls animating (bouncing around), and want them to stay within a circle. I want the balls to bounce off the inside walls of the circle.

Thanks.

Justify Text Inside A Circle?
Hello everyone,

OK so what I need is the equivalent of a circular dynamic text box.

The only way I can think of doing it is to split the text up into individual characters and then place them individually (all via AS) within the circle. Your thoughts?

Anyone already solved this and would like to share their code?

Random Movement Inside Circle
Hi,
I am trying to figure out a way to randomly move a circle inside a bigger circle. However the inner circle must not touch the outer one. The motion has to be smooth and completely random.

P.S: I tried out the tutorials on kirupa.com but I can't figure out a way to make the small circle stay inside the bigger one.

Thanks,
Max

Bouncing Balls Inside Of A Movie Clip Circle
I have been playing with multiple different AS3 bouncing ball tutorials in an effort to have the balls bounce inside of a circle or other shape instead of just the stage.

Does anyone have any ideas of things to try?

I have a pretty good grip on the physics part, I am just trying to figure out how to make the balls stay inside of a certain boundary. Most of the tutes I have seen discuss top, bottom, left, and right....They do not touch on shapes that are not perfectly square.

Any ideas or direction would be greatly appreciated!
Thanks Brian

Bouncing Balls Inside Of A Movie Clip Circle
I have been playing with multiple different AS3 bouncing ball tutorials in an effort to have the balls bounce inside of a circle or other shape instead of just the stage.

Does anyone have any ideas of things to try?

I have a pretty good grip on the physics part, I am just trying to figure out how to make the balls stay inside of a certain boundary. Most of the tutes I have seen discuss top, bottom, left, and right....They do not touch on shapes that are not perfectly square.

Any ideas or direction would be greatly appreciated!
Thanks Brian

How To View All Coding Inside Fla File Inside A Notepad File
As the title says, how one would be able to view the overall coding inside a .fla file, with the help of notepad. I donot want to use actionscript editor.

Using "_root." Inside An Imported External .swf File
The Dust again with one more small (and hopefully final) little piece of ActionScript trouble in the project I'm working on.

I have attached "stage1.swf" to a movie clip on the main timeline ("_level0"). My question is... Why doesn't any actionScript inside of "stage1.swf" with the command "_root" in it work anymore, and what should this be replaced with?

I'm guessing this is an easy fix, but I've done my homework here and can't find a quick answer. Anyone got any ideas?

Dust

Tweening External Dynamic Text Inside A MC Inside Main Timeline
I've seen a hundred and a half posts on similar subjects, but goshdarnit, I just can't make this work. Let me explain the problem, and I've included a link to a Zip file with my .fla file and the away.txt file I'm calling the variables from.

Basically, I want to create an interactive menu thing, that starts with a row of each of the 26 letters of the alphabet. When one clicks on a letter, the letter is tweened to a larger faded state, and so is the rest of the alphabet, and I want the names of the schools starting with that letter to then fade in. I have a movie clip inside the last frame of the main tween, which should then tween (fade in over 12 frames) the graphic symbol containing my dynamic text box, which is supposed to be linked to the text variables in the external file. The text variable is created on the first frame of the main timeline using Actionscript on the static header layer, and so I should be able to load it inside my movie clip (I think). Everything looks fine to me, but then I've only been using Flash for 2 weeks.

To sum up, I need to tween the graphic symbol. The graphic symbol contains the dynamic text which references the external text file. The graphic symbol is inside a movie clip, inside one frame of my main timeline. The text isn't showing up, only the empty text box is.

My Zipped source files can be found at: http://www.tolcs.org/athletics/away.zip

If anyone would be willing to download my source files and give some wonderful advice, I'd revere and adore them forever.

Circle Filled With External Image
I have an array with URL's to images.
like http:/mysite/1.gif e.t.c
I need to create as many circle's as I have url's
and "fill" circles with loaded images.
How it is possible?
I whant to use circlelike a frame, to see only that part of picture that is in circle.
See picture.

I am new in Action script, I try to search web for this question but didn't find the answer.

thank you.

Using External .txt Inside Movie Clip Inside .fla
I've seen a hundred and a half posts on similar subjects, but goshdarnit, I just can't make this work. Let me explain the problem, and I've included a link to a Zip file with my .fla file and the away.txt file I'm calling the variables from.

Basically, I want to create an interactive menu thing, that starts with a row of each of the 26 letters of the alphabet. When one clicks on a letter, the letter is tweened to a larger faded state, and so is the rest of the alphabet, and I want the names of the schools starting with that letter to then fade in. I have a movie clip inside the last frame of the main tween, which should then tween (fade in over 12 frames) the graphic symbol containing my dynamic text box, which is supposed to be linked to the text variables in the external file. The text variable is created on the first frame of the main timeline using Actionscript on the static header layer, and so I should be able to load it inside my movie clip (I think). Everything looks fine to me, but then I've only been using Flash for 2 weeks.

My Zipped source files can be found at: http://www.tolcs.org/athletics/away.zip

If anyone would be willing to download my source files and give some wonderful advice, I'd revere and adore them forever.

Create Mc Inside Mc
hello all. i try to create a movieclip through a function. that clip should contain another clip where a jpg is loaded into. why is it not possible to set the inside clip to _visible=false? the idea is to have a mc with an animation and a mc with a picture in it, all contained by one mc. when the mouse rolls over this mc the picture is visible and the animation not, when the mouse rolls out the picture is not visible and the animation plays once. onRelease and the picture stays...


createButton = function (btName, xpos, ypos) {
this.createEmptyMovieClip(btName, this.getNextHighestDepth());
with (this[btName]) {
_x = xpos;
_y = ypos;
createEmptyMovieClip('pic', this.getNextHighestDepth());
}
with (this[btName].pic) {
loadMovie('pic.jpg', this);
_xscale = 10;
_yscale = 10;
_visible = false;
}
};
createButton('buttonName', 10, 10);

any help is highly appriciated!!
thanks,
sdii

How Do I Create This? - Example Inside
I want to create a animated slide show (I think that's what its called) on my site, how would I go about learning how to do this? I'm learning flash currently

http://www.templatemonster.com/flash...tes/17062.html

(see how the pictures slide and change

How To Create A GIF From Inside An SWF?
I have a Flash application that allows users to arrange images, in the form of imported SWF MovieClips, into a scene of their choosing. I would like to save these custom scenes into static GIF files on the webserver. I'm not sure if this is possible solely with ActionScript or if I'd have to do some work with PHP/GD or Java, but I have seen it done before (Yahoo! Answer avatars) so I know it's possible.

I'm very new to actionScript. So far I've found the functions for dealing with bitmap data but none for file creation. Can anyone point me in the right direction? As you may guess, it's hard to Google for variations of "flash create gif" because this is also a function of the development tools.

Thank you for your advice and suggestions!

Create Inside?
Hello,

I found this tut from another forum but I can't get it

Quote: I created a new movieclip linkaged as "tank" and inside this movieclip I created another one instanced as "cannon".

Create inside? Thus this mean I have to double click the movieclip "tank" and create another layer named "cannon" from that symbol?

How Can I Create Animation Like This? Look Inside.
it sorta like 3d mixed with 2d,

if you look at the matrix has you, the burly brawl scene, you'll know what i mean, can someone help plz..

you can see the matrix has you at newgrounds.com

http://www.johnandrichie.com/

Create A Menu Inside A MC
Hi

I have a MC name mcCat
I like to create a menu inside that MC

I have a XML file that read in a other MC so I like to take some info from that and put that inside the mcCat and create a menu

Right now I have a list and that is not so nice

Right now I have

Code:
_parent._parent.listcat.addItem(currentCategory);
I have try a little with attachmovie but that was not so easy

Create MC Inside A MASK
Easy when you use the stage but I need to do it dynamically:

To create different container inside a mother container I use:

MC_Container.createEmptyMovieClip("MC_" + i, 10+i);

How can define a mask for each of the containers?

Create A Menu Inside A MC
Hi

I have a MC name mcCat
I like to create a menu inside that MC

I have a XML file that read in a other MC so I like to take some info from that and put that inside the mcCat and create a menu

Right now I have a list and that is not so nice

Right now I have
CODE_parent._parent.listcat.addItem(currentCategory);

Create Mc's Dynamically Inside A Mc
What I want to do is create a number of movie clips dynamically, inside one main clip. I want to be able to apply one mask to this main clip (and therefore i'm masking all the mc's inside it).

kind of like using loadMovie to load a swf to a target clip?? except using attachMovie instead? (cos when I used loadMovie to a target clip another time it totally didn't work on Mac and it was dodgy as).

Some help please?

Thanks!!!

Nick Fracture

Frame Independent Circle To Circle Detection
I am having trouble trying to get my head round this part of programming.
I know it is used for detection between movieclips such as snooker balls. I just cant get my head around it and it is driving me nuts!
Does anyone know of any good tutorials that I can use to solve this problem?

Thanks

The Toffee

Create And Draw Inside MovieClip
Im messing about with a simple starfield type script, but I want each "star" to be inside a movieClip so I can mess with it's properties.

Any ideas as to why this isn't working:


Code:
/*************************************************
DECLARE VARIABLES
*************************************************/
var go_btn:Button;
var lineWidth:Number = 2;
var lineColor:Number = 0xFFFFFF;
var lineAlpha:Number = 100;

this.lineStyle(lineWidth, lineColor, lineAlpha);

/*************************************************
RUN NOW
*************************************************/
go_btn.onPress = function() {
for (var i:Number = 0; i < 500; i++){
var nextDepth:Number = this._parent.getNextHighestDepth();
var instanceName:String = "star_" + i;
var startX:Number = Math.round(Math.random() * 540) + 10;
var startY:Number = Math.round(Math.random() * 390) + 10;
var stopY:Number = startY - 1;

this._parent.createEmptyMovieClip(instanceName, nextDepth);
this._parent[instanceName].moveTo(startX, startY);
this._parent[instanceName].lineTo(startX, stopY)
}
}

Create Variable Inside MovieClip
Hi ..

this seems relatively straight forward but i can't seem to get it to work. I have a loop that creates a container_mc that increments each time ( container_mc1, container_mc2 etc ) and inside that another movieClip called property_mc. I am wanting to create a variable inside property_mc that gets a propertyID assigned to it during the loop.

Anyone have any idea bout how to go about this ?


Code:

var i;
for (i = 0; i < propertyDetails.length; i++) {
trace(propertyDetails.getItemAt(i).propertyID);
var container_mc:MovieClip = this.createEmptyMovieClip("container_mc" + i, i);
var property_mc:MovieClip = container_mc.createEmptyMovieClip ("property_mc", i);
var myText_txt:TextField = property_mc.createTextField("myText_txt", getNextHighestDepth (), 0, 80, 100, 20, [myText_txt.htmlText = '<a href="http://www.linkhere.com.au">' + propertyDetails.getItemAt (i).suburb + '</a>']);
formatText ();
createPropertyBox ();
loadPropertyImage ();
container_mc._x = (i % 5) * 120;
container_mc._y = Math.floor (i / 5) * 120;
}
is the loop code that creates the clips.

It means you would have a variable created each time within property_mc, it can use the same name as it's unique within the incremented container_mc's

That variable would be assigned the value of (i) each iteration.

Any help GREATLY appreciated

How Would I Create A Flash Generator (example Inside)?
http://www.blingpixie.com/Generators/Dark-Angel/

I am looking to create a flash generator that is similar to the one above. It doesn't have to be animated or anything.

If anyone can help me, that would be awesome!: )

Thanks a lot.

Create Controls Inside A Container?
So I am now creating a checkbox at runtime with the following code:

import mx.controls.CheckBox;
createClassObject( CheckBox, "button2", 5, { label:"Test Checkbox" } );

Is there a way to create a button inside another object like a ScrollPane (or something else?)? I created a ScrollPane at designtime, and would like the checkboxes, as well as text and perhaps draw lines within it at runtime. Is this possible? If not, is there another container which would allow this?

I am trying this with the following code:

CounterScrollPane.createClassObject( CheckBox, "button3", 5, { label:"Test Checkbox" } );

but that doesn't work.

Any thoughts?

Thanks!

Create Textfields Inside A New Movieclips?
Hi !
Still have problems with this after several hours of blood, sweat and tears .
My goal is to make a interface where you can input text, push a button and the text appears in the center of the stage. After that the text can be rotated, moveable, you can change font, size and color. As it is now you can create only one textfield and change color of the text, nothing more...

Im having problems. Works fine when I create the first textfield, but when the button is pushed the second time it just overwrites the first field. Im using getNexthighestDepth to get a new clip with new text in it everytime I push the button. It´s also not possible to drag the text around the screen.

So my questions are, how do I create a new textfield everytime I push the button without overwriting the old one and why does not the drag function work? Code below.


Code:
//When the button called "knappast" is pushed a movieclip is created
//and also a textfield inside the movieclip. The textfield contains the text
//from the textinput field called "textin".
//Problems with this: Everytime you push the button it overwrites the last
//created text.
createEmptyMovieClip("mc", getnexthighestdepth());
mc.createTextField("txt1", 0, 200, 175, 200, 35);
mc.txt1.border = true;
mc.txt1.background = true;
mc.txt1.autoSize = "left";
mc.txt1.selectable = false;
mc.txt1.text = textin.text;

}
//You are then supposed to be able to drag the movieclip with the
// textfield, but that isnt working.

mc.onPress = function() {
this.StartDrag();
};
mc.onRelease = function() {
this.StopDrag();
};

Can You Create A <form> Tag Inside Flash?
Hi, are you able to create a <form> tag inside a flash movie....if I wanted to create a feedback form, driven by php, how could I insert the form tag and all the <input> tags into my flash movie?? any help thank you

Is It Possible To Create Buttons Inside Scrolling Text Box?
Hi -

I have built a scrolling text box. I want it to act as a menu for other parts of the site, so that it's contents can contain links, and even call functions. But, I can't seem to figure out how to do it, or even if it is possible.

Any suggestions?

Thanks!

Jeff

Help Needed To Create Popups Inside Flash
hey guys,

can someone help me make some nice popup windows that can have scrollbars and all for my flash? i dont know how to do it and i was wondering if it was hard to make a nice animation for its appearance on the screan

i know its hard to understand (im strage )

thanks in advance cya guys

How To Create A Preloader Inside A Movie Clip?
Hello anybody!! :P

Well, i am triying to make a preloader inside a movie clip...
In the movie clip i load a jpg file whit this script:
on (release) {
gotoAndPlay("f2");
}

on (release) {
loadMovie("fotoindoor2.jpg", "foto 2");
}

How To Create A Preloader Inside A Movie Clip?
Hello anybody!! :P

Well, i am triying to make a preloader inside a movie clip...
In the movie clip i load a jpg file whit this script:

on (release) {
gotoAndPlay("f2");
}

on (release) {
loadMovie("fotoindoor2.jpg", "foto 2");
}

the problem is that the jpg is a bit large and it takes time to load...

What can i do to make a preloader, which would be activated when the jpg is "called"????

Thanks!!

Daerion! :P:P

Delegate.Create For An Mc Inside A Class [DEADLINE] Pls Help
PHP Code:




import mx.events.EventDispatcher;
import mx.utils.Delegate;

class main_movie extends MovieClip
{
    public var pbSend:Button;
    public var my_mc:MovieClip;
    public var my_button:MovieClip;

    // constructor
    public function main_movie()
    {
        super();
        EventDispatcher.initialize(this);
        my_mc = attachMovie ("my_mc", "my_mc", getNextHighestDepth(), {_x :100, _y:50} );
        my_button = attachMovie ("my_button", "my_button", getNextHighestDepth(), {_x :100, _y:50} );
        my_button._x = 100;

        // I want to avoid doing this function here..
        /*this.onLoad = function()
        {
            // this is the only line that works and it does add the event.
            pbSend.addEventListener("click", Delegate.create(this, checkFields));

            // doesn't work
            my_mc.addEventListener("onRelease", Delegate.create(this, checkFields));

            // doesn't work
            my_button.addEventListener("onRelease", Delegate.create(this, checkFields));
        }*/


        //this["my_mc"].addEventListener("click", Delegate.create(this, checkFields));
    }

    // I would rather do it here...
    private function onLoad ()
    {
        // doesn't work, this line doesn't work in the onLoad function if its placed here !
        //pbSend.addEventListener("click", Delegate.create(this, checkFields));

        // doesn't work This is the most important one I really need to get it to work
        my_mc.addEventListener("onRelease", Delegate.create(this, checkFields));

        // doesn't work
        my_button.addEventListener("onRelease", Delegate.create(this, checkFields));
    }

    private function checkFields():Void
    {
            trace("check");
    }
}








Hi I need help, all I want to do is to create an onRelease event for the my_mc
clip which is being attached within the main_movie class.

it works for the button component but not for the mc clip... please advice

thanks

Create And Insert Info Inside A Datagrid
I have try to find any good information how I can insert information inside a datagrid.

I think I maybe going to use that to create a nice chat with ASP and MS-SQL

I going only use columns "time" "user" "message"

I like to set a width on time column and user

Do anyone have any good link or can give some information how to do this?

How Do I Create A Flash Slideshow Inside An Image?
Hi, I would like to create a flash slideshow inside an image of an lcd tv, how do I go about this? When I add the tv to the stage and add the images I want displaying on the tv, I try the movie and it fades my tv out along with the pics. I would like my tv to be the background and stay still whilst the pics fade in and out.
Many Thanks

How Do I Create A Textfield Inside A Movieclip At Runtime?
I thought this would be simple, but it has proven not to be.

I have a Movie Clip on my stage called contentMC.
With ActionScript 2.0 I can create a textfield inside this MC at runtime using: contentMC.createTextField("contentText", 1, 0, 0, 300, 200);

With ActionScript 3.0 I can create the same textfield using:
private var contentText:TextField = createTextField(0, 0, 300, 200);
but I have no idea how to create it inside contentMC?

Please help.

Please, Help Me To Create An Event Handler Inside The Loop
Hi Guys...!
Ok, I already received some help to make this loop code works, so now
I can load my external pics (jpg files) into my swf using this loop code scripted below. But how can I create an event handler (onPress, onRollOver...)for these 6 pics loaded ?
I already put my var loadMe:MovieClip outside the loop, and I tried to script "loadMe.onPress = function():Void { callling other function } and
holder.loadMe.onPress = function():Void { callling other function } " inside the loop as in other codes but it did not work.
Does anybody know any solution for this case ?
My target is: make all pics loaded available to event handler... !


var numberOfPics:Number = 6;
var holder = this.createEmptyMovieClip("holder", 1);
holder._x = 10;
holder._y = 250;

function initialize():Void {
var loadMe:MovieClip;
var startX:Number = 0;
var startY:Number = 0;
var mc_width = 80;
var mc_height = 53;
for(i = 0; i < numberOfPics; i++) {
loadMe = holder.createEmptyMovieClip("loadMe" + i, i+1);
loadMe._x = startX;
loadMe._y = startY;
startX += mc_width + 10;
var MCLoader:MovieClipLoader = new MovieClipLoader();
var picToLoad = "image_"+(i+1) + ".jpg";
MCLoader.loadClip(picToLoad, loadMe);

}
}

initialize();


Well, I saw an example from Adobe book similar to mine, but it loads movie clips from the library using an event handler inside the loop.
This is the code from the book. It was modified by me, but it is still working.

var linkageArr:Array = ["A", "B", "C", "D", "E", "F", "A", "B", "C", "D", "E", "F"];

initialize();

function initialize():Void {
var depth:Number;
var clip:MovieClip;
var card:MovieClip;
var x:Number = 10;
var y:Number = 10;
for(var i:Number = 0; i < linkageArr.length; i++) {
depth = this.getNextHighestDepth();
clip = this.attachMovie(linkageArr[i], "clip" + depth, depth, {_x: x, _y: y});
clip.onPress = function():Void {
onCardClick(this);
};
if((i + 1) % 3 != 0) {
x += clip._width + 5;
}
else {
x = 10;
y += clip._height + 5;
}
}
}

function onCardClick(cardClip:MovieClip):Void {
trace(cardClip._name)
}

How Do I Create A Textfield Inside A Movieclip At Runtime?
I thought this would be simple, but it has proven not to be.

I have a Movie Clip on my stage called contentMC.
With ActionScript 2.0 I can create a textfield inside this MC at runtime using: contentMC.createTextField("contentText", 1, 0, 0, 300, 200);

With ActionScript 3.0 I can create the same textfield using:
private var contentText:TextField = createTextField(0, 0, 300, 200);
but I have no idea how to create it inside contentMC?

Please help.

Create Layers And Frames Inside A MovieClip
Well, I guess the subject is pretty self-explanatory, but I'll clarify: I'd like to dynamically create MovieClips and then create layers (and frames, but for now my interest is in layers only) inside them. The only solution that comes to mind is to create additional MovieClips inside the main MovieClip to pose as layers. Any suggestions?

Thank you in advance.

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