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




Loading Movieclips From Library



Excuse my ignorance here,

Can you load a movieclip into a flash movie that is in the library and not present anywhere on the stage?

How do you do this? eg loadmovie? telltarget?

I am currently using loadmovie to load external swf files, and have never thought about this method till now.

Also, if this is possible, where does the movieclip appear and can you control this aspect? Or would you have to place a small button exactly where you want the clip to appear (maybe set the alpha to 0%)?

Sorry for the twenty questions, thanks in advance.



FlashKit > Flash Help > Flash ActionScript
Posted on: 09-24-2001, 06:55 AM


View Complete Forum Thread with Replies

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

Loading Movieclips From Library:HELP
Ok here's my question: Trying to use Kirupa's tutorial for transitions, but instead of loading external .swf's, I'm trying to load movieclips located in my library. All movieclips have been given proper linkage identifiers and am trying to load into a path such as this:

Code:
_root.folioClip.viewerClip
Basically I'm loading into an empty movieclip that' nested inside another movieclip that's sitting on the main stage. The code that I'm using to trigger my buttons is:

Code:
on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "ONE_mc";
_root.folioClip.viewerClip.attachMovie("ONE_mc");
} else if (_root.currMovie != "ONE_mc") {
if (_root.folioClip.viewerClip._currentframe >= _root.folioClip.viewerClip.midframe) {
_root.currMovie = "ONE_mc";
_root.folioClip.viewerClip.play();
}
}
}
And code that I'm using at the end of each movieclip is this:

Code:
_root.folioClip.viewerClip.attachMovie(_root.currMovie);
Problem is that when I test the movie anc click on the buttons, nothing happens. I thought that it might be a path problem, but I'm not sure. Can you not load movieclips from the library using the code found in Kirupa's tutorial on Transitions? Can some please help? THANKS A MILLION!!!

P.S. that space in between the M and "ovie", in that last code is not my doing. It jut keeps showing up in the forum like that. Thanks Again!!!

Dinamic Loading MovieClips From Library
Hey all!

Please help!

Well, I have a few clips in library and few bottons on the stage.
Botton instance names: btn1, btn2...
Clip instance names: btn1Anim, btn2Anim...

And folowing code:


ActionScript Code:
btn1.addEventListener(MouseEvent.CLICK, MovieClipIn)
btn2.addEventListener(MouseEvent.CLICK, MovieClipIn)

...


function MovieClipIn(e:Event):void{
    var AnimName:String = e.target.event + "Anim";
    var movie:AnimName = new AnimName();
    movie.x = 0;
    movie.y = 150;
    addChild(movie);
}

It does't work!
....

Thank you...

Loading Consecutive Movieclips From Library
I have a long animated demo (approx. 5 minutes) that I want to shrink down to several small movie clips. This way if I have to go back and make changes I don't have to continue modifying a huge timeline.

So what I want to have happen is to have a sequence1 loaded from the library on the stage. When sequence 1 is finished playing sequence 2 is loaded in it's place, etc.? Thanks!

Loading Consecutive Movieclips From Library
I have a long animated demo (approx. 5 minutes) that I want to shrink down to several small movie clips. This way if I have to go back and make changes I don't have to continue modifying a huge timeline.

So what I want to have happen is to have a sequence1 loaded from the library on the stage. When sequence 1 is finished playing sequence 2 is loaded in it's place, etc.? Thanks!

Help With Dynamically Loading Jpgs Into Library Movieclips
I'm working on a project where someone has already sued a few library items throughout the movie. I need to make the images in these movieclips dynamic now. Does anyone know how to load these library items before the timeline and other objects start to use it?

I tried something with the movieClipLoader class, but its a little buggy. When a jpg doesn't load and calls onLoadError, I wanted it to load a default image, which works but slowly.

Any help would be greatly appreciated, I feel like I'm missing something obvious here.

Loading Movieclips From Library At Runtime - Complicated Issue
...or not.

I've made a carousel kind of interface that I populate with objects at run time. When developing I just used a placeholder movieclip in the library that has an external .as file to it as well, declaring the class and so on. Now I want to keep that external .as file (it's generic for all carousel items) but populate the carousel with more items from the library. That is: I want to fill the carousel with different graphical objects that are of the same class (if that's the right way of saying it . This is where I run into trouble. How do I get the .as file to use different movieclips from the library dynamically? Or do I have to write separate classes (i.e. copying the class that I already have) for each individual carousel object? Surely that can't be right - or?

Thanks in advance!

.cristian

Library Movieclips
I'm trying to make an animated face which blinks and smiles, stuff like that. Unfortunately I've run into a little trouble.
To save time in the long run i made all the clips in the library. So for instance the blinking eyes are a library movieclip. However this means while the eyes take 24 frames to blink in the scene 1 timeline they only take 1 frame.
This is causing it to be hard to start things at different time as either every one of my movie clips have to start in the first frame and finish at the same time or it starts acting strange.

Any ideas?

Help With Movieclips In The Library
Hi, I had a problem associating with the movieClips (not swf) in the library. I dragged and put all these movieclips on the stage. As u could see from my attached file, all the actionscripts are written inside the movieclips itself individually and none on the stage. The actionscript written in the movieclip is actually to load my CSS file so that the movieclip can change with the css. However, when I first run the fla file as swf, the movieclip appeared initially without css (color change), but after a few sec, the css appeared, which resulted in the "jerky" action. I know this may sounds confusing but if u could take a look at my attached file and run it urself, u'll see wad I mean. (And if u can't see it clearly on the first run, run it again but don close the window of the first run..)
Anyone can help? Any help is greatly appreciated!

Load Movieclips From Library?
I've got the hang of loading a external .swf movie into another but I was wondering if it is possible to load movieclips that are in my movie's library in the same fashion?

Targeting Movieclips In The Library?
Hey All,

Just curious as to if anyone knows of a way to target Library items by name?

Here's what's goin on......
I have a box let's say, I make it a movieclip and am coloring it using setRGB.

But I use this same clip [instances of] embedded in a number of movieclips. Is there a way to script it so that all instances are colored without writing multiple setRGB scripts each with a different path to it's subsequent instance?

Like if I could target the library item instead of the instance I'd be set.

Any Ideas?

-j-

Attaching Several Movieclips From Library?
Hey

I have a for-loop where I want to attach several movieclips from library. I have tried:


Code:
var movie:MovieClip;

for (i = 0; i < 20; i++)
{
movie = attachMovie("MCname", "MCname"+i, getNextHighestDepth);
movie._y = 31+31*i;
}
When I test the movie only the last clip shows. Is this because it only works for 1 clip. I've tried some other things like duplicateMovieClip and so on, but can't get it to work..

Getting Movieclips From The Library Dynamically
Hi I'm in the midst of a painstaking port from AS2 to AS3 on a game I have created. Now a piece of code I use a lot is for example;


function wave() {
for(var i:int = 0; i<10; i++) {

enemies.attachMovie("enemy"+i, i);

}
}

that way I can get enemy1, enemy2, enemy3,... and so on from my library.

how do I go about doing he same thing in AS3?
I have tried

var nextEnemy:MovieClip = new [enemy+i] as MovieClip;

and so on, but none of it works, any tips?

Random MovieClips From Library
Hi,

I have Symbol 1, Symbol 2 and Symbol3 in the library as movieClips. I have a button in the first frame and upon clicking it, I want to call the random movieClips from the library. I have made linkage identifiers to the actionScripts
for all. I am using following code:

Button1.onRelease = function(){
myNum = Math.floor(Math.random()*3)
myReaction = "Symbol " + myNum
_root.attachMovie(myReaction,"myReaction_mc",0,{_x :100.0, _y:100.0})
}

But this doesn't work. Is the codes suppose to be in the frame or the button? I've tried both ways and it doesn't work. How do I do this? Help please~

Thanks.

Inheritance With Library Movieclips
I have three movieclips in the library that are exactly the same except for a background image and some static text. The movieclips nested within these MCs that I refer to are named the same in all three library MCs. These movieclips will serve as button like objects. Behavior for all three is identical except for the results of a MOUSE_UP event.

Of course, linkage creates individual classes for each and that's how it has to be. I've written a class for one of those library MCs that has the same name as the linkage class so that I can control the behavior of the object when it's on the stage. Mostly, it's a matter of MouseEvents and responses to them. In these classes, I explicitly reference two nested movieclips, the ones referred to in the previous paragraph. Again their names are the same in all three MCs. It all works just as intended.

My problem is that I don't want to have three such classes that are almost identical. So it strikes me that I should have a super class that does all the things that are exactly the same in the three MCs in the library and have the linkage base classes for each of those handle what little is distinct between them.

But I can't seem to find a way that works. If I explicitly reference objects in the linkage base classes in the super class, those objects aren't recognized. This is obvious enough. I can't seem to successfully pass these references to the super classes from the subclasses, either.

I hope this makes sense.

Any ideas?

BTW, I realize that I could just build the movieclips without using the library base classes at all. This wouldn't be that hard to do. But for reasons related to my collaborators on this project, I'd prefer not to.

Swapping Movieclips From Library
I'm working on modifying a example website that automatically resizes to fit the browser window...well the "background" resizes and the text is fixed. Anyway its working with the one clip in but now I want to swap between the existing background slide show and a new one from an external swf. In AS2 I could just load the new movie in layer 0 and be good to go but now...AS3 and I are NOT friends at this point.

thanks for any suggestions.

Scripting Library Movieclips
How to get movieClips in the library to have scripts attached to them. So that I can attachMovie() a scripted object. as of now I have to duplicate them from the scene >_>

I tried pressing F8 and re-adding a MC that I scripted to the library, but when I took it out again it had no script anymore..

//Erik

Attaching MovieClips Not In The Library
I'm just coming back to Flash after not using it for a few years, and I'm struggling with a particular aspect of ActionScript 2 (I'm still using Flash 8). I am creating something along the lines of an image grid or "video wall" of still images. The image grid will randomly show different images, and I want any cell in the grid to have access to the full array of images to choose from.

I want to dynamically load in the individual PNG bitmap files from the server to facilitate swapping them out, rather than baking them into a SWF. At the root level, I've managed to use MovieClipLoader to load my PNG files into a dynamically generated array of MovieClips. My image grid is a bunch of instances of of a MovieClip which contains a mask, decorations, and a placeholder MovieClip for the images.

What I can't figure out how to do is attach the PNGs to the placeholder clips. It seems like my two options are attachMovie and attachBitmap. However, both of them require you to specify a linkage ID to a library asset, which I do not have- I have an array of MovieClips not contained in the library!

I'd really appreciate it if someone could point me in the right direction.

Draggable Movieclips From Library
hello,
so the basic functionality of what i'm trying to do is outlined in the topic summary. i have buttons which add movieclips from the library to the stage using addchild. i would like these movieclips to also be draggable, so i've created a class file outlining the function (called Clipdragger). what i'm having trouble with is the constructor code that assigns these movieclips to my Clipdragger class.

I've assigned the clips classes so I can use the buttons to add them to the stage, but this seems to be causing some conflict in trying to get them to relate to the Clipdragger class.

So I suppose my question is, how would the constructor read? i am getting compiler errors when i use: var missionpop:Mission = new Clipdragger();

1151: A conflict exists with definition missionpop in namespace internal
and for my actionscript...
5000: The class 'com.slesite.mouse.Clipdragger' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type. (even though i have code saying that Clipdragger extends MovieClip)

What's going wrong? Any help would be incredibly appreciated.








Attach Code

// i use this var to define a class for the movieclip "missionpop"//

var missionpop:Mission = new Mission();

// it operates this function through a button listening for it//
function missfn (e:MouseEvent): void {
missionpop.x = 125;
missionpop.y = 100;

addChild(missionpop);

}

Adding Movieclips From Library
Hi, I want to add 20 Moviclips at a time by Loop, from Library. so can any body tell me how could it possible.
I can add one MovieClip just by as:
var mc:Movieclip = new MovieName();
But i need some string type method which can add multiple MovieClips from Library at a time.
in AS2 there was a method for attchMovie, in which we can add Linkage name with Name0, Name1, Name2 as 'Name'+i.....

So is it also possible in AS3 or not?

Accessing MovieClips From Library
In Kirupa's tutorial http://www.kirupa.com/developer/mx/full_site2.htm

it shows action script that accesses pages that are separate files from the scene you're currently working on.

example:

on (release) {
_root.contents.loadMovie("locations.swf");
}

but that is not what I want, I want to click on a button and have it load up a movieClip that I have already within my scene's internal Library. I couldn't figure out what to type into the search engine to find out anything and I don't know what to change in the action script.

Thanks in advance.

Attaching MovieClips Fromthe Library
Hey could someone help me out here?

I am using this code to attach a library movieClip with the linkage instance name of can 15 times to the stage when running. This works fine but i am having heaps of trouble as i am trying to get the var x to distribute at increments of 20 along the y axis which is currently set to 355.

So when it is running it would look something like this::

[] [] [] [] [] [] [] [] [] [] [] [] [] [] []


the cod i am using on frame 1 of the movie is:

totalCans = 15;
screenWidth = 550;
screenHeight = 400;
for (var i=0; i<totalCans; ++i){
var name = "can"+i;
_root.attachMovie("can", name, i);
var x = random(screenWidth);
var y = 355;
_root[name]._x = x;
_root[name]._y = y;
}

Library MovieClips Not Included With Component
I'm making a component which uses some movieClips that are in the library (using attachMovie). Everything works perfectly, however for some reason, if I drag the component object from the library into a new movie, it doesn't take the other movieClips with it.

I tried doing this with other components and it works.

Does anyone know how I can get the component to recognize that the other library elements must be packaged with it and included with the component?

Thanks in advance for any help.

Attaching Code To Movieclips In Library
Im making a game and i want to load in with actionscript movieclips in the library. However, i want these movieclips to contain code that will load with them onto the stage, and from what ive heard attachMovieclip doesnt do this. I dont want to have a clip existing on the stage in the begining and then use duplicateMovieclip. Anyone know if this can be done or how to do it?

Load Images Into Movieclips In The Library
Hi how would i load images into seperate movieclips created in the library?

i tried this but it does not seem to work


Code:
var thisMC:MovieClip = this.attachMovie("one0","do",0);

mcLoader_mcl.loadClip("file:///C|/Zoom/19.jpg", thisMC);

var mcLoader_mcl:MovieClipLoader = new MovieClipLoader();

and i tried



Code:
var thisMC:MovieClip = this.attachMovie("one0","do",0);
thisMC.loadMovie("file:///C|/Zoom/19.jpg");

[CS3] Animating Multiple Movieclips From Library
Hey everybody. So I'm pretty new to actionscript, but learning fast. I've just got a problem thats stumping me. I have a bunch of movieclips in my library that I'm adding to the stage randomly, and having them move across the stage. I've got them all to add correctly, and randomly, and they all move the way I want them to, but I have a problem. Once the function runs again, to spawn another movieclip, the movieclip that was moving before stops. So now I've got a bunch of movieclips scattered across my stage. I want them to keep moving independently of eachother. I tried using a loop and tried to give them all unique names but I'm not quite sure how to do that. Here is the code I am using:

(The movieclips are different countries, hence the names)


Code:
for (var i:int = 0; i <= countriesInGame; i++)
{
//chooseCountry();
//createCountry();
countryMaker.addEventListener(TimerEvent.TIMER, createCountry);
countryMaker.start();

trace(i);
}

function createCountry(event:TimerEvent):void
{
country = chooseCountry();
country.x = -200;
country.y = Math.random() * stage.stageHeight;
country.speed = Math.floor(Math.random()*5+1) ;
container_mc.addChild(country);
country.countryTimer = new Timer(20);
country.countryTimer.start();
country.countryTimer.addEventListener(TimerEvent.TIMER, countryMove);
}

function countryMove(event:TimerEvent):void
{
country.x += country.speed;

if (country.x >800)
{
container_mc.removeChild(country);
country.countryTimer.stop();
country.countryTimer.removeEventListener(TimerEvent.TIMER, countryMove);
country = null;
}
}
function chooseCountry():MovieClip
{
var pick:MovieClip;
var c:Number = Math.floor(Math.random()*30) + 1;

switch (c)
{
(There are a lot of cases here that I edited out cause it would take up the whole page)

}
return pick;



So yeah, if anyone can help me add these movieclips to the stage and get them to move independently, that would be awesome. Thanks!

Library Links On Embedded Movieclips
hi,..

Im having trouble getting library links to work inside movieclips ..

Eg,..

I have a main Flash file that loads games into a movieclip.
When this game mc is run by itself, everything runs fine.

But when i run it inside another mc,
The library links don't work.

Has anyone else had this kind of problem ?
Please Explain ?

Shared Library Movieclips Via Actionscript
Hi,

I have one.swf file contains all movieclips which are exported for runtime sharing. I want to use those movieclips in second.swf using actionscript.
Any help please?

Thanks,
Naresh

Load/ Unload Movieclips From Library
Hi, I'm doing a site in which movieclips appear and disappear all the time. For this I use _visible. I was told this causes a lot of strain in the CPU. Can anyone tell me how to load and unload movieclips from the library on the press of a button?

Thanks

Movieclips Disappearing On IDE When Using Shared Library
Anyone had problems with CS3 and invisible MovieClips on the stage because of a shared library item?

I have these problems only in the IDE. The files export and work correctly, but it's hard to work with them. Sometimes the imported items are invisible, sometimes the parent MovieClips are too.

I described the problem and posted a video here:

http://www.kirupa.com/forum/showthread.php?t=290719

I thought of a "workaround": work with guided layers and make an export JSFL script that switches guided layers on before exporting, then back off. Not nice, but what else can I do?

Movieclips In Library Playing Before Attachment. Why?
Hello,

I started useing AS3 about 4 days ago. Today I'm learning to attach movieclips from the library to the stage useing addChild. Something very stange is happening though. It seems like the movieclips I set up only being stored in the library (off the stage) are automatically playing inside the library when i test the movie. When I click my button to attach, the animation and the sound have already played out and it's at the end of the timeline at stop();

Movieclips in the library did not do this with AS2 so this is all new to me. Why is this happening and how do I fix it.

Any help would be great. Thx in advance.

-cheers

Attaching ActionScript To MovieClips In The Library
Hello everyone! Here is a question for ya.

In my library I have a bunch of movieclips that are dynamically going to be placed on my stage. Is there a simple method of attaching ActionScript to these movieclips so that when they are used on the stage, they have the script applied to them already?

Thanks in advance!

Attaching Movieclips From Library Into A Movieclip
I have a MC shape, its actually a parallelogram and so its slanted and the perspective is tilted a bit (not sure if this matters).

I also have a few different MCs in the library the same shape which I want to place into the MC shape when different buttons are pressed.

For button one, I used this code:

on (release) {
myShape.attachMovie("firstMC");
}

Am I doing something wrong or using the wrong code? In the library, I named the first MC "firstMC" as you can see. I also put the linkage as "export as actionscript".

Any clues?

Particle Effect Using Movieclips From Library
Hi all,

so I am requesting a little help to connect a few pieces of code I have; the end result being a particle effect that propels 9 different movieclips (pulled from the library) off 'into space'.

Here is the code to call a single movieclp, which I was able to create myself :


Code:
var i:Number=0;
function createMusic() {
origin.attachMovie('music', "music"+i, i);
i++;
}
myinterval = setInterval(createMusic, 500);
Here is code that I found on another post, that seems to call more than one movieclip onto the stage : please note that it is in its original form, check below for my attempt.


Code:
createThingSpeed = 2000;
var i = 0;
var myinterval;
cliparray = [ ];

newThing = new Array('blue', 'green', 'red', 'tint', 'yellow', 'black', 'purple');
newThrow = new Array({mc:"drop1", x:100, y:100}, {mc:"drop2", x:100, y:100}, {mc:"drop3", x:100, y:100}, {mc:"drop4", x:100, y:100});
function shuffle() {
return Math.floor(Math.random()*3)-1;
}
newThrow.sort(shuffle);
newThing.sort(shuffle);
function makemovies() {
var clip = attachMovie(newThrow[i].mc, newThrow[i].mc, i);
trace(newThrow[i].mc);
clip._x = newThrow[i].x;
clip._y = newThrow[i].y;
clip.attachMovie(newThing[i], newThing[i], 1);
i<newThrow.length-1 ? i++ : clearInterval(myinterval);
}
myinterval = setInterval(makemovies, 2000);
Here is my attempt to call movies from the library :


Code:
newMusic = new Array('blue', 'green', 'red', 'tint', 'yellow', 'black', 'purple');
function shuffle() {
return Math.floor(Math.random()*3)-1;
}
newThing.sort(shuffle);
function makemovies() {
origin.attachMovie(newMusic, newMusic, 1);
trace("hit");
}
//set interval to make it play
And here is the movement code, which I was able to make work on a mc already on the stage. This code is from another forum post.


Code:
//duplicate mc, and then...
onLoad = function() {
this.origin.music._x = 100;
this.origin.music._y = 100;
speed = .03;
gravity = .03;
spread = -1+Math.random()*(2);
trace("hit");
};
onEnterFrame = function() {
this.origin.music._x += speed;
this.origin.music._y += spread;
speed += gravity;
if (_y>400) {
this.removeMovieClip();
}
};
I would like to use the 1st code block and the 3rd and 4th code block together, to call all nine of the 'color' mcs to the stage and have them fly off. I seem to have trouble with target paths. And my main problem is some sort of tracker that can track all the 'color' mcs on stage, and apply the physics to them. I wanted to provide you with all of the code, and I know it is quite a mess - obviously many pieces from seperate code quotes don't belong together, and can be replaced. The final design could be distilled into three general ideas:

//load 1 through 9 mcs, randomly
//track mcs on the stage
//apply mc names to physics code

I just wanted to provide my process so that anyone can see that I am thinking about these things.

Thanks for the help!

Nick

Preloading Into Movieclips Located In The Library
I need to load external .swfs into movie clips I have in my library.

I think I'm missing something here. I have 30 movieclips in my library (instance_1, instance_2, etc....) They all have a unique linkage (instance_1, instance_2, etc....) and are placed far off stage in the 2nd frame then are placed into an array and tweened via actions script. I want to make each one load an external .swf in a sequnce when the playhead enters the frame my 3D code is in. My problem appears to be with attachmovie or some other function...



here is the site:
http://bravist.com/bravist.html
-You can see I currently have a preloader (similar to one here on kirupa http://www.kirupa.com/developer/acti...cliploader.htm) in the first 3 movieclips, but I want one common preloader that draws the external files from an array and places them into my clips



here is a section of my code that controls my movieclips:


Code:
var numItems = 29;
var focalLength = 1000;
var centerX = (Stage.width *.5);
var centerY = (Stage.height*.5);


for(var i = 0; i<=numItems;i++){
this.attachMovie("instance_" + i, "instance_mc_"+i,i);
clip = this["instance_mc_"+i];

myXYarray = new Array([(Stage.width*.217)-centerX, (Stage.height*.25)-centerY],
[(Stage.width*.224)-centerX, (Stage.height*.26)-centerY],
[(Stage.width*.231)-centerX, (Stage.height*.27)-centerY],
[(Stage.width*.238)-centerX, (Stage.height*.28)-centerY],
[(Stage.width*.245)-centerX, (Stage.height*.29)-centerY],
clip.x = myXYarray[i][0];
clip.y = myXYarray[i][1];


myzarray = new Array([(focalLength*.150)-focalLength],
[(focalLength*.175)-focalLength],
[(focalLength*.200)-focalLength],
[(focalLength*.225)-focalLength],
[(focalLength*.250)-focalLength],
clip.z = myzarray[i][0];

clip.swapDepths(-clip.z);
As you can see I already have attachmovie to load my clips into the array, but I can't get a preloader to work.

Many Thanks,

Load Random MovieClips From The Library
Hello,

I need to load random movieClips from the library to a middleStage container on my stage.
I already have this.


ActionScript Code:
for (i=1; i<7; i++) { this["btn"+i].iD = i; this["btn"+i].onRelease = function() {    _root.currentItem1.swapDepths(300);      _root.currentItem1.removeMovieClip();      _root.currentItem1 = _root.middleStage.attachMovie("Animation"+this.iD, "Animation"+this.iD, 1); };}


I just need to add to that random loading to the middleStage this will only work when the user is not interacting with buttons = btn's.

please some advice.

thanks.

Attaching ActionScript To MovieClips In The Library
Hello everyone! Here is a question for ya.

In my library I have a bunch of movieclips that are dynamically going to be placed on my stage. Is there a simple method of attaching ActionScript to these movieclips so that when they are used on the stage, they have the script applied to them already?

Thanks in advance!

Trouble With Sound Library/sub-movieclips/preloading
I'm building an application in MX that needs to use a fairly large library of sounds that are exported for actionscript in the first frame (as per the default linkage settings) and the movie won't display the first frame until it finishes downloading all the sound data.

I tried building a preloader file that would load my application into a movie clip, but the sounds would never play from inside the clip. I'm never referencing the _root in any of the script, so I'm not sure where the problem is. I can't figure out how to even check to see if the sound files are being attached to the sound object when I call them or if it's simply doing some sort of stopallsounds command at random.

I have also tried loading the application into the root level of the pre-loader but even though the sounds work properly when I do it, the preloader graphics are all wiped out as soon as the application begins to load and I'm stuck leaving users with a blank screen until all the files finish loading.

Does anyone know of a problem with defining a sound object inside of a movie clip (I tried setting them all to _root also and that had no effect either) or is there some problem with referencing an externally-loaded library if it's not in the main timeline? I would have just spread out all the sounds on different frames but the whole point of the application is to make it simple to dump a bunch of sound files into the library without having to attach them to specific frames.

Generating And Renaming Movieclips In The Library Via Actionscript?
I have a movieclip in my library named emptyClip that I want to use multiple copies of at any given time. This clip contains another movieclip as well named movementClip.

My dilemma is that I cannot seem to figure out how to dynamically rename my clip when I call it with actionscript. I simply want to be able to add a number to the end of each one created. (emptyClip0, emptyClip1, emptyClip2, etc.)

How is this possible?

Thanks in advance for any and all help!

[AS3] Attaching Buttons / Movieclips From Library That Contain Other Items Already
So im trying out AS3 and kinda havin some issues. I want to be able to attach a button or a movieclip that I have constructed in the Flash IDE - it contains a textfield, some other movieclips, etc.

If i make it a button, I have tried subclassing the simplebutton class, attaching that class to the button, and then creating new instances of that class. That works fine - until I have to access, say, a textfield in the button. It seems that these elements are drawn, but are not accessible (or even connected in any way - i used flash.utils.descibreType(mybutton) and the instance names dont even show up in the XML).

So, I thought about a different route - using a movieclip or sprite, and making it react LIKE a SimpleButton. Not what I had in mind, but whatever. Unfortunately, it seems that when I subclass Sprite or MovieClip, the class has to be made dynamic in order to attach things to it from within the IDE before compilation (as opposed to from actionscript).

What is the best method to create a button in the Flash IDE with textfields, sprites, etc, and have access to those elements from the class that's attached to the symbol??

[F8] Import Library Movieclips From External .swf And Use AttachMovie()?
I have not attemped this before and could not find information on exactly how to do this.

I have 2 .swfs - 1 has assets in the library that are set to export on the first frame, but nothing on the stage.

The second .swf is the master program that I want to loop through the library of the assets file and display all the movieclips in the master file.

I have read some things about ApplicationDomain or using skeleton classes with import statements to make the assets available but have been unsuccessfull.

Does anyone know where I can find an example on how to do this?

Thanks!
TJ

How To Access Nested Movieclips Inside A Library Item, From A Class
Hey everyone,

I got this dilemma, i have a Sprite in the library linked to a class. Inside the sprite i have a MovieClip and a TextField. My question is: how can i access the MovieClip / TextField from my class? (i want to add a MouseEvent to the MovieClip, also i want to change the text in the TextField).

Thanks in advance.

Syntax Problem For Adding MovieClips Dynamically From The Library Onto The Stage
Hi guys,

I am trying to use the addChild method to add a MovieClip from the library onto the stage. I have a set of MovieClips with classes named: Definition1, Definition2, and so on... up to Definition12.

What I am trying to do is to write a function so that depending on the function parameter (which is a random number generated from 1 to 12), it will load different MovieClips starting with "Definition" followed by the random number. I have something like this but the syntax is incorrect. Can someone please correct me on my syntax? Thanks!!


Code:
private function attachDefinition(random:uint):void {
var _definition:MovieClip = new ["Definition" + random.toString()];
this.addChild(_definition);
}

Loading Movieclips Into Other Movieclips
Hello, not sure if this is possible but...

I've got a random number of dynamically generated movieclips.

I want to put all these movieclips inside a scrollpane.

I realise that I can only have 1 movieclip inside a scrollpane, so

how can I load each of these random movieclips into my container clip?

Cheers for your help

Loading Movieclips Into Movieclips
what i want to do is have one movieclip load and play certain movie clips whenever a certain button is pressed. i am doing this in my video game, as when u press left, it will load the left walking animation and play it while it moves, then when u release the left arrow key, it will load the standing still animation.
any help would be appreciated!

Loading MC From Library
Hi ... I need to know if ther's any way to "loadMovie"
from the library

Loading From Library?
hey,

is there anyway to give a .jpg in your library a linkage name, and not have it export on the first frame, but have it load when a user clicks a button later in the movie?? and if so, how would you make a preloader for this kinda thing??

jake

Loading From Library
ok, I'm pretty new to flash, so this might sound like a stupid question but I have been having heaps of trouble with it.

I have a blank movieclip on my stage and I want load a different movieclip from the library, (not external) or be able to import an external png file into a movieclip, or import a jpeg with transparencies. any of these will do.


and i want to do it using action scripting, can anyone please help me I'm desperate.

thanks
Saz

Loading From Library?
I need to put together a standalone (though this shouldn't matter) swf which has a bunch of same size images which will randomly appear on the stage in several instances. Similar to a windowpane of MCs which basically are the same thing, but will show different images at different times.

I can deal with the random part of the actionscript, but was wondering if there was a way to have the MC randomly choose an image from the library of the fla file? My other option is to create an MC with many keyframes each with it's own image on it.

I was thinking that if I could do it without all of those keyframes, it might work a little better.

Any ideas? Or am I totally confusing everyone?

RH

Loading MC's From The Library?
Hi,

Don't know if this is possible but i have nothing but a button on my stage. I would like to code the button so that on release the MC loads from the library into the stage - possible? I'm sure it is but just don't know how to do it...or even where to start?

Cheers,
Å

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