Heirarchy Of Empty Clips
Ok gang, I'm having a problem understanding the heiarchy of empty mc's within eachother. I have my main stage and an empty movie clip which loads the galleries when called upon. Now the gallery pages have buttons which are MC's and and they load the main images into the gallery swf. Now the main stage loads the gallery fine into the empty clip on the main stage, but when it loads, some of the functions in the gallery do not work. The button rollovers do not work and they do not load the main pictures into it's own empty mc. I just don't understand how you would write that code onto the buttons. Here is an example of how I have the code in the gallery mc. on(release){ unloadMovie("_root.photoloader")
loadMovie("mary.swf","_root.photoloader"); } Now when that gallery with the above code loads into the main stage, nothing works. (photoloader is the empty MC which is on the gallery stage.
THanks
Ultrashock Forums > Flash > Flash Professional
Posted on: 2004-07-03
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Empty Movie Clips And Duplicating Clips
I've been trying to reproduce an animation effect I've seen on the Armani website, but I'm stuck trying to duplicate an empty movie clip with image loaded into it. The duplicates exist and I can move them, but they are invisible. Since the duplicates reside on depths above the intitial clip I'm confused about why they are invisible. The duplicates are scripted to follow behind the initial clip - each offset by 30 pixels (though I don't have that working perfectly).
I'm attaching a simplified version of my file to isolate just the duplication troubles. Thanks for the help!
Empty Movie Clips
Can anybody tell me the process how to load movies into an empty movie clip when you press a button?
Empty Movie Clips
If you have 5 empty movie clips on the stage, how can you load 5 separate swf files?
Thanks
Ecinele
Levels Or Empty Clips?
Is it better to load external .swf's into levels or empty clips?
Much appreciated if someone could list some pro's and con's
Levels Or Empty Clips?
Is it better to load external .swf's into levels or empty clips?
Much appreciated if someone could list some pro's and con's
Masking Empty Movie Clips
I am having a litte difficulty doing a set mask to a empty movie clip. here is my code from a button, the mask's instance name is "mask" and the position is set on the stage where the pic is placed. Any help would be greatly appreciated.
on(release){
createEmptyMovieClip("pic" , "");
_root.pic.loadMovie("test.jpg","");
_root.pic._x = 15;
_root.pic._y = 15;
_root.pic.setMask(_root.mask);
}
www.laker.net
Pre-Loaders And Empty Movie Clips
hello,
I am trying to design my first sight by loading .swf's into empty movie clip, but I am having difficulty with the progress bar pre-loader. I am not sure how to access the proper level to for the progress bar to reference.
here is a sample of some of the script:
loadpercent = "0%";
loadBytes = "0%" + Math.round(("_root.play.getBytesTotal()" /1024) * 1000) /1000 + "Kb";
the empty movie clip is named "play". There is an. fla attached.
I hope this is enough information!!!!
thanks
Empty Movie Clips Question...
if i am loading .swf's into an empty movie clip or to into level 0, does flash automatically remove the existing movie? Or do I have have to remove it using actionscript?
Buttons And Empty Movie Clips
ok...heres what i have
my main movie has a menu, and two empty movie clips named
SMALLSTAGE & BIGSTAGE.
in the menu i have a button named
"photographs"
when clicked it loads "pics.swf" into my "SMALLSTAGE" movieclip
"pics.swf" has 3 buttons in it.
i want those buttons to load their corresponding "*.swf" files into
the "BIGSTAGE" movieclip.
i'm sure this is easy..but i keep trying differnt things and i just
can't seem to make it work.
PLEASE HELP....OH GOD PLEASE HELP!?!?!?
wanna look at the clip?
http://www.knuckle.ca/new/newpage.html
Creating 75 Empty Movie Clips?
hey... i have an action that i want to carry out 75 times with a different pic each time...
and i know i could just paste this code 75 times then go back in and change the numbers beside each varrible
but i would think there is an easer way...
heres my action
Code:
_root.createEmptyMovieClip(("pic1"),1000);
_root.pic1.loadMovie("http://www.the-quota.com/cabo/"+_root.picture);
_root.pic1._xscale = 20
_root.pic1._yscale = 20
does anybody know what i could do?
Empty Movie Clips Vs LocalConnection
I was trying to use LocalConnection to create this site, but it was being too difficult to find the right code to do it since i could only find tutorials and examples using .text but anyways, I achieved the same result by just using an empty movie clip to run my movie, now... my question is this... can i run the whole site with empty movie clips, or would i enconter any anomalies while having many files/pages/documents?...
Arrays And Empty Movie Clips
I am trying to figure this out but I am beating my brain about it and I need some fellow Flash geek help.
I am creating an interface where a child can choose the number of games they want to play. When they click ENTER, they are taken to another screen where they choose the games they want to play. When they choose a game it adds the name of the game in the array. Once the number of games they wanted are chosen, they are taken to the "Game Play" screen. Here is where I have hit the snag...
Each game has an icon that represents that game. What I am trying to do is only have the icons of the games they chose on the screen and not the icons of ALL the games. I have 12 empty movie clips on the screen (one for each icon). I tried to use attachMovie and attach the movie clip to the empty movie clip using the names in the array but it doesn't work. I used this basic code:
tasksArray = new Array;
tasksArray[0] = "task01_mc";
tasksArray[1] = "tasks02_mc";
for(x=0; x < tasksArray.length; x++){
var num:Number = x + 1;
empty0[num]_mc.attachMovie(tasksArray[x], "empty0[num]_mc",1);
}
Unfortunately I get a syntax error with this code because of the _mc after [num].
I have traced out the array to see if everything is in there and it is correct.
Help! Something like this is usually no problem for me and I can think it through but I need some help on this one. I am probably just overthinking.
If anyone can help I would really appreciate knowing what I am doing wrong OR if someone has a better way of doing this.
Attaching/creating Empty Clips, Etc.
i'd like to know the best way to take a movie clip and either attach or createEmptyMovieClip on it with each iteration of a loop. The newly attached/created clip will then load a new picture, check bytesLoaded vs. bytesTotal and alpha fade the new clip in.
I've got it working in that the first time the function 'fires' a new clip is created and the image loads and the clip fades in. subsequent clips are either not being attached, or are not properly measuring the bytesLoaded (via .onEnterFrame) or there's something wrong in general with the way i'm trying to do this.
perhaps my .onEnterFrame function is only being applied to the first created clip? if so, i have no clue of how i could get around this!
also, does anyone know how to delete a clilp that's been dynamically created? i don't want thousands or even hundreds of createEmptyMovieClips stacked on top of each other and bogging down flashplayer.
here's wha i have so far:
Code:
startSlides=function(){
//other unrelated code here that i deleted so as not to confuse!
this._parent.largePic.createEmptyMovieClip("clipp"+i, 5);
this._parent.largePic["clipp"+i]._alpha=0;
trace("clipp"+i);
this._parent.largePic["clipp"+i].onEnterFrame=function(){
trace("loading pic!!!");
var bytes_loaded = Math.round(this.getBytesLoaded());
var bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
if (bytes_loaded != bytes_total) {
trace("still loading!");
} else {
trace("pic loaded!");
fClip=this;
var fadeIn:Tween = new Tween(fClip, "_alpha", None.easeNone, 0, 100, 1, "true");
fadeIn.onMotionFinished=function(){
delete this.onEnterFrame;
}
}
}
Unloading Empty Movie Clips?
Basically,
on my flash site i've been loading external .swf files by
using the createEmptyMoiiveClip method. . . like so :
PHP Code:
on (release) {
createEmptyMovieClip("imageholder22", 111);
imageHolder22._x = 210;
imageHolder22._y = 0;
loadMovie("X_Main_NewNews.swf", "imageholder22");
}
Only problem is, is that i need to unload them
when i load a second external movie clip in the same location
i've tried using the unloadmovie + removemovieclip method
but it doesnt work
i dont want to load a movie over the inital movie as i need
to load the inital movie once the second movie is unloaded!
u get me?
help!!!!!!!!!!!!!!!!!!!!!!
Creating Empty Movie Clips
I'll be brief, I know I can do this:
var mc:MovieClip = new MovieClip();
But how do I do the following (written in older code of course)?:
for (var i:Number=1; i<numPics; ++i) {
this.createEmptyMovieClip("picHolder"+i, i)
}
I'm still learning, so be gentle with me. Any input appreciated greatly,
Dan P.
Choosing Where You Want Your Empty Movie Clips
hello,
I want to create a full flash site. I have my main back ground and I have an area where I want to create an Empty Movie Clip so that I can load other swf files to act as link in website. What tool do I use (or code to write) to select a rectangular area where I want an Empty Movie clip to show other Movies Clips and content I have for my page. If this is confusing I'll try it again.
Thanks
Pre-Loaders And Empty Movie Clips
I am trying to load contact.swf into an empty movie clip found within a file called main.swf . The instance name of the empty movie clip is"play".
At the start of my .swf that I am attempting to have a progress bar that indicates the percentage loaded. I've inserted five frames at the beginning of the contact.swf and the following details the scripting found on each frame:
1)
2)loadpercent = "0%";
loadBytes = "0%" + Math.round((_root.play.getBytesTotal() /1024) * 1000) /1000 + "Kb";
3)if (_root.play.getBytesLoaded() == _root.play.getBytesTotal()) {
loadPercent = "100%";
loadBytes = (Math.round((_root.play.getBytesLoaded() / 1024) * 1000) /1000 + "Kb of" + Math.round((_root.play.getBytesTotal() / 1024) * 1000) /1000 + "Kb total Loaded.");
gotoAndPlay("start");
}
4)gotoAndPlay (2);
5)stop ();
Then there is a movie clip within contact.swf named
mc-LoadBarFill which contains a grey bar located to the right of the centre point. Here is the scripting found in the frames:
1) this._xscale = ((_root.play.getBytesLoaded() / _root.play.getBytesTotal()) * 100);
2) gotoAndPlay (1);
When I load the main.swf and click on the link to contact.swf, the pre-loader doesn't work. Is there something wrong with my scripting?
thanks..
If/else And Data In Empty Movie Clips.
Hi everyone, long time no post. Just wondering if its possible to get AS to find out whether a swf has been loaded into a emptymovieclip? E.g. A if else statement to have AS do this or that depending on whether there is a movieclip in the empty movieclip. Anyhelp is as always much appreciated.
thanks in advance legion.
Scrolling Empty Movie Clips
I did a search for this through the forum, but didn't come up with anything conclusive. I have created an empty movie clip, and attached it to load an external swf file. Everything works well, except that the contents of the external swf file spill over the parameters of the empty movie clip when it's loaded, and onto the rest of the layout. What I would like to know how to set it so that the contents of the swf file stay within the box that is the empty movie clip, and have the empty movie clip scroll the loaded content, which is composed of some pictures and text. Thank you in advance for you help.
AS 2 Empty Movie Clips Not Loading
I am trying to make a video player that after it is done playing it will pop up 3 choices for the user to choose from and play the next video. It all works when i test it on my machine, but when i put it up on a test site nothing loads into the empty movie clips that i have in the player. Any help would be great... i have tried everything i can think of and i am going crazy...
Choosing Where You Want Your Empty Movie Clips
hello,
I want to create a full flash site. I have my main back ground and I have an area where I want to create an Empty Movie Clip so that I can load other swf files to act as link in website. What tool do I use (or code to write) to select a rectangular area where I want an Empty Movie clip to show other Movies Clips and content I have for my page. If this is confusing I'll try it again.
Thanks
Is It Possible To Mask Created Empty Clips?
I'm creating an empty movie clip, loading and image into it and setting a mask for it...for some reason its ignoring my setMask command.
Here's the code
ActionScript Code:
this.createEmptyMovieClip("imageLoader", this.getNextHighestDepth());
this.imageLoader.loadMovie("texture1.jpg");
this.createEmptyMovieClip("imageMASK", this.getNextHighestDepth());
this.imageLoader.setMask(this.imageMASK);
[as2] Creating Empty Movie Clips
I have a problem:
Code:
onClipEvent(load){
_alpha=0;vis=100;
_parent.createEmptyMovieClip('imga',-10);
_parent.createEmptyMovieClip('imgb',-10);
_parent.createEmptyMovieClip('imgc',-10);
_parent.imga.loadMovie('img/ident/img/img1.jpg');
_parent.imgb.loadMovie('img/ident/img/img2.jpg');
_parent.imgc.loadMovie('img/ident/img/img3.jpg');
}
onClipEvent(enterFrame){
_parent.imga._x=0;
_parent.imgb._x=267;
_parent.imgc._x=513;
_alpha+=(vis-_alpha)*.4;
if((_parent.imga.getBytesLoaded()==_parent.imga.getBytesTotal())and(_parent.imgb.getBytesLoaded()==_parent.imgb.getBytesTotal())and(_parent.imgc.getBytesLoaded()==_parent.imgc.getBytesTotal())){
vis=0;
}
}
I need to create 3 new Movie Clips and load jpgs using these new clips. This code I posted is from an mc controller. Testing the movie, I note that only the last one mc was created and worked loading the jpg.
Anyone know why this is happening? Why can't I create 3 mcs in just one time?
Using Empty Movie Clips To Store Variables
I'm trying to find a way to store my data (i.e., variables) as I load .swfs on several levels. I've heard that a good way to do this is to send it to an empty movie clip which each of the .swfs access. Has anyone done this? Can you give me an example, including paths?
Much Thanks,
Rick
Calling Swf Files Into Empty Movie Clips
I have a major problem. My freelance site is the main swf file, then the portfolio pieces are a separate swf file. In the portfolio section, scene7, of my main file (flashsite.swf), the background images are all in frame1 over several layers. In the top layer of that scene, I have an empty movie clip, portfoliomovieclip.swf. The actionscript associated with that keyframe is the following:
loadMovieNum("portfoliomovie.swf", _root.portfoliomovieclip);
Portfoliomovie.swf is the actual swf file with my portfolio pieces; portfoliomovieclip.swf is the empty movie clip in scene7 of my main movie, flashsite.swf. What I'm trying to do is call my separate swf file(portfoliomovie.swf) from the server so my portfolio pieces don't increase the file size of my main movie/site(flashsite.swf). Here's my problem. When I preview my main movie or view it on the internet, the swf file that is supposed to be called into the empty clip(portfoliomovie.swf) is all that shows up and nothing else; the rest of my site doesn't show at all. And, on top of that, the separate swf file that's called from the server doesn't work properly. I need help because I can't figure this one out! Thanks!
Loading Images Into Empty Movie Clips
Can anyone tell me how to load an image called "frame.png" into an empty movie clip on the stage called "frame"?
I tried doing this on the first frame of the main timeline (there is only one frame in the movie so far)
loadMovie("images/frame.png", "frame");
This doesn't work. What am I doing wrong?
Thanks
Generate Empty Movie Clips W/ Scrollbar
Hi,
I'm looking to create an app where I can dynamically load images into it, and control them with a scrollbar. Take a look at this image if you don't understand what I mean:
http://www.ianarmstrong.com/1.jpg
What I'm looking for is some tutorials to give me ideas on how best to go about this. I'm getting the dynamic info from XML. I need to know how to generate the empty movie clips for all the images, then load the images and have the whole thing controlled with a scrollbar.
Create Multiple Empty Movie Clips
Ok so basically I have a button that will create a empty movie clip and attach some things into that clip When the button is first clicked. My problem is that when the button is clicked a second time. The clip will reload itself and I need it to duplicate. So if I hit the button 5 times, there would be 5 items on the stage.
Here is what I'm doing.
Code:
hold1.onPress = function(){
trace("your hit me");
_root.createEmptyMovieClip("conHolder",1);
//conHolder.hitArea = conHolder.content;
//_root.attachMovie(conButs,conBut,3)
_root.conHolder.attachMovie("conButs", "conButs", _root.getNextHighestDepth()+1);
_root.conHolder._x = 100;
_root.conHolder._y = 100;
_root.conHolder.startDrag();
//_root.conHolder._x += (_root._xmouse-10-this._x);
//_root.conHolder._y += (_root._ymouse-10-this._y);
_root.conHolder.conButs.hold.loadMovie("icons/couch2Seat.swf",1);
}
Thanks for all and any help.
Duplicating Empty Movie Clips With Contents
Ive got a problem i hope some of you actionscript heroes can help me with.
Ive made a emptymovieclip (with createEmptyMovieClip) containing lineTo contents and managed to duplicate that clip. So that works.
BUT....
When i do the same, but with more several empty movieclips inside the original empty movieclip with lineTo contents, the copies from duplicate are empty :P
so this works:
(emptyclip1) with drawing ->
duplicated creates ->
(emptyclip copy) with drawing
but not:
(emptyclip1) with (many emptyclips) with a drawing in each ->
duplicated creates ->
(emptyclip copy) with nada :P
What im hoping for is this:
(emptyclip1) with (many emptyclips) with a drawing in each ->
duplicated creates ->
(emptyclip copy) with with (many emptyclips) with a drawing in each
so.. anyone else had this problem and solved it?
Creating Empty Movie Clips And Loading Swf
K guys i have another dilemma. Can you believe it? heh. I have text on my main page and buttons that load text into my main text. I have another page that creates and empty movie clip and loads a swf file in it. It has thumbnail buttons on it that are going to launch pictures. K heres my question.
How do i get rid of the text once i create my movie clip and load my swf file? Is there script i can use to clear out the text? Basically the text is still visible below my movie clip. Also when i click on my text button i want it to come back and the movie clip to dissapear. I have no idea if this is possible. I tried going to another frame but the buttons go berserk when i do this. My buttons dont work anymore.
Thanks
Stan
Empty Movie Clips - Navigation Issue
I'm pretty new to site building so bare with me.
I'm building a site with empty movie clips on each page to provide navigation to other pages. I'm testing linkage between two pages, (home page and news page) When I load the home page, everything works fine, I click the link to my news page, and it loads in fine, BUT when I click back to home from the news page, the home page starts playing nested movie clips that should NOT be auto-playing.
So basically, I have nested movie clips that decide to play when I click to my home page from another page. If I load the home page by itself however, it functions properly. Why are these nested clips playing?
Here is the action script for the nested movie clips as an example:
_root.rightChair.onEnterFrame = function() {
if (mouse_over_rightChair) {
_root.rightChair.nextFrame();
} else {
_root.rightChair.prevFrame();
}
};
Basically they should not be playing unless a mouse rolls over them.
Thoughts anyone?
-Stephen
Creating Dynamic Empty Movie Clips?
Hi,
I'm looking to create an app where I can dynamically load images into it, and control them with a scrollbar. Take a look at this image if you don't understand what I mean:
http://www.ianarmstrong.com/1.jpg
What I'm looking for is some tutorials to give me ideas on how best to go about this. I'm getting the dynamic info from XML. I need to know how to generate the empty movie clips for all the images, then load the images and have the whole thing controlled with a scrollbar.
Loading Videos As Empty Movie Clips?
Hi,
I have a encountered a problem. Is it possible to load a swf file as an empty movie clip to show a video in that certain area u want it to load in when you press the link for it? Now I've coded everything right to my knowledge, but the clip won't load properly and I don't even know why. Can someone, anyone possibly help me with my issue please? Thanks in advance.
http://www.razme.com/media.swf
http://www.razme.com/razbeatz.swf
Creating Empty Movie Clips In A Class
I have a project in which I am using classes...
I want to use a class in where from a xml object I create an array of movie clips using createEmptyMovieClip ..but I can't figure out how...
here is a my code
class classes.Patratel extends MovieClip
{
var mcPatratel:MovieClip;
function Patratel(_parinte:MovieClip)
{
this.mcPatratel =_parinte;
createMc();
}
function creazaMc()
{
var mcTemp:MovieClip=new MovieClip();
this.mcPatratel.createEmptyMovieClip("mcTemp",this .mcPatratel.getNextHighestDepth());
mcTemp.beginFill(0x009000,100);
mcTemp.lineTo(100,0);
mcTemp.lineTo(100,100);
mcTemp.lineTo(0,100);
mcTemp.lineTo(0,0);
mcTemp.endFill();
}
}
Empty Movie Clips From Multidimensional Array
Does anyone know why I keep getting "undefined" with this code? I'm trying to create some empty clips - each using the name of the "holder" element in the array below:
ActionScript Code:
var DIR:String = "";var groupinfo:Array = [{mc:overview, display:"overview", toload:DIR+"overview.jpg", holder:image1_holder}, {mc:capabilities, display:"capabilities", toload:DIR+"capabilities.jpg", holder:image2_holder}, {mc:case_studies, display:"case studies", toload:DIR+"case_studies.jpg", holder:image3_holder}, {mc:clients, display:"clients", toload:DIR+"clients.jpg", holder:image4_holder}, {mc:news, display:"news", toload:DIR+"news.jpg", holder:image5_holder}, {mc:recognition, display:"recognition", toload:DIR+"recognition.jpg", holder:image6_holder}, {mc:contacts, display:"contacts", toload:DIR+"contacts.jpg", holder:image7_holder}];for (var j:Number = 0; j < groupinfo.length; j++) { var holderName:String = groupinfo[j][4]; _root.createEmptyMovieClip(holderName, j+900, {_x:93, _y:84}); trace(holderName);}
Create Multiple Empty Movie Clips
Ok so basically I have a button that will create a empty movie clip and attach some things into that clip When the button is first clicked. My problem is that when the button is clicked a second time. The clip will reload itself and I need it to duplicate. So if I hit the button 5 times, there would be 5 items on the stage.
Here is what I'm doing.
Code:
hold1.onPress = function(){
trace("your hit me");
_root.createEmptyMovieClip("conHolder",1);
//conHolder.hitArea = conHolder.content;
//_root.attachMovie(conButs,conBut,3)
_root.conHolder.attachMovie("conButs", "conButs", _root.getNextHighestDepth()+1);
//_root.conHolder._x = 100;
//_root.conHolder._y = 100;
_root.conHolder.startDrag();
_root.conHolder._x += (_root._xmouse-10-this._x);
_root.conHolder._y += (_root._ymouse-10-this._y);
_root.conHolder.conButs.hold.loadMovie("icons/couch2Seat.swf",1);
}
Thanks for any help.
Creating Empty Movie Clips In A Class
Hy all...
Here is my problem
I have a fla that has only this code
var x:Myclass = new MyClass("myxml.xml");
and it should take the information from xml and convert it into movie clips using classes
to do that I use this class
class classes.Patratel extends MovieClip
{
var mcPatratel:MovieClip;
function Patratel(_parinte:MovieClip)
{
this.mcPatratel =_parinte;
}
function createMc()
{
var mcTemp:MovieClip=new MovieClip();
this.mcPatratel.createEmptyMovieClip("mcTemp",this.mcPatratel.getNextHighestDepth());
mcTemp.beginFill(0x009000,100);
mcTemp.lineTo(100,0);
mcTemp.lineTo(100,100);
mcTemp.lineTo(0,100);
mcTemp.lineTo(0,0);
mcTemp.endFill();
var my_color:Color = new Color(mcTemp);
if (this.fundal=="negru") my_color.setRGB(0x009900);
if (this.fundal=="albastru") my_color.setRGB(0x0099FF);
}
}
And in MyClass I call something like this
var dDefefinitie =new Definitie(parent)
where parent was this and _root
and when i debug it it look like this
this.parent.parent.parent./.......and it never end
Please give me a link to something ..how I create movieclips inside classes....
Create Empty Clips Doesn't Work
Hi,
I'm having probs with this code:
ActionScript Code:
this.timeline={};
for (i = 0; i<=3; i++) {
var mc = this.timeline.createEmptyMovieClip ("test"+i, 1000); trace(mc);
}
For your info, this.timeline is an Object. The output is:
undefined
undefined
undefined
undefined
But if you remove the this.timeline, it works:
ActionScript Code:
for (i = 0; i<=3; i++) {
var mc = createEmptyMovieClip ("test"+i, 1000);
trace(mc);
}
The output is:
_level0.test0
_level0.test1
_level0.test2
_level0.test3
If you're wondering what the heck that this.timeline is for, here's why:
it supposedly adds a reference, to the clip created, to the object (here, it's this.timeline).
Can anyone help with this problem? (Sorry if my explanation doesn't make sense.)
Creating Empty Movie Clips, Moving Them, And Masking
I read a few of the tutorials on the site to get to where I am now. However, I've tried multiple variations of this code and I can't seem to get it to do what I want.
This is what I'm trying to do:
All of this will be on a button Rollover event.
There will be a picture (the pic will change based on which button is rolled over).
On rollover, there will be a series of 15x15 black(or any color) boxes created that are masks and will slide from left to right on the screen stopping 1 or 2 pixels apart and creating a grid through which you can see the photo underneath. The area this grid will cover will be 15 boxes wide and 10 high (also, don't forget to account for the 1 or 2 pixel border in between each box).
The code I've created is attempting to start these boxes at a y value that increases by 16 (or 17 depending on border width) EVERY time until it's done 10 boxes and then the y value resets to the original value to start the next column. It also uses "mc_tween2.as"... the include statement is in the first frame of my movie. So, I'm also attempting to xSlide the movie clips to a certain ending x value which will change after 10 movie clips.
I'm trying to get it to do all of this within 3 seconds. That means creating 150 (50 per second) movie clips and having them all slide in to expose the underlying picture.
It's not working. It freezes and then a few seconds later says "flash is running slow...blahblah... would you like to abort the script". Any suggestions you guys could make would be incredible. I'm also open to doing this a different way. I've thought about cutting the picture into 150 different small movie clips and sliding them in, but I haven't the foggiest idea how to even START that procedure.
Here's the code:
Code:
x = -350;
y = 58;
_root.wait = 1;
ercogHit_btn.onRollOver = function() {
ercog_mc.scaleTo(300, 1.5, "easeOutElastic"); //movie clip that scales when button is rolled over using "mc_tween2.as"
for (i=1; i<=151; i++) {
for (delayTime=0; delayTime<=1; ) {
if (Math.floor(getTimer()/20) == _root.lastTime+_root.wait) {
_root.lastTime = Math.floor(getTimer()/20);
createEmptyMovieClip("clip"+i, i);
y += 17;
if (y == 245) {
y = 75;
}
with (clip+i) {
moveTo(x, y);
beginFill(0x000000);
lineTo(x+15, y);
lineTo(x+15, y+15);
lineTo(x, y+15);
endFill();
slidingMovie(i);
}
}
delayTime = ((Math.floor(getTimer()/20)-_root.lastTime));
}
i++;
}
};
function slidingMovie(i) {
xFactor = i;
if (((xFactor/10)-previousFactor)>1) {
endingPosition = 151;
this.xSlideTo(endingPosition-(previousFactor*17), .1, "linear");
previousFactor++;
}
}
Loading 4 Different SWFs With Sound Into 4 Different Empty Movie Clips?
Okay I posted this into the ActionScript 2.0 Forum, but I'm not sure that's the exact category so here it goes again, just in case...
I'll try to make a long story short: I have 4 diffferent SWF files containing music loops activatd via ActionScript inside them. Well, I am doing a music player that:
1) Loads randomly one of those 4 SWFs.
2) After it has been loaded, it makes the music start playing, displays the usual STOP and PLAY buttons, and then starts loading the 3 remaining SWFs.
3) After these 3 remaining music SWFs have loaded, it displays the Previous Track / Next Track buttons.
I've been trying this with two different techniques:
1) Loading the SWF files with loadMovieNum.
Assuming the random number is 3, I would use
loadMovieNum("arriba3.swf",23);
... so these 4 files are loaded into levels 21 to 24.
2) Loading the SWF files into an empty movie clip.
I used a technique explained in http://www.flashguru.co.uk/000044.php
So I create a new empty movie clip; its instance name is holder1 to holder4, and its depth is 1 to 4, both depending on the random number.
These two methods are okay, but when I start loading the other 3 music SWFs, the music that is playing suddenly stops. It happens Whether I use the 1st or 2nd approach, but let's have a look at the second use, which seems more comfortable to use...
... It seems like the empty movie clip that I create is being "overwritten" by the new ones. Here's the code I use to load the first movie randomly:
Code:
// Generate a random number between 1 and 4
pelicula = Math.round(Math.random()*3) + 1;
trace(pelicula);
this.createEmptyMovieClip("holder"+pelicula,1);
contenedor = eval("holder" + pelicula);
contenedor.loadMovie("arriba"+pelicula+".swf");
//check the download status of the external movie once every frame
this.onEnterFrame=function(){
//trace the percentage of the movie that has loaded
percent=(this.contenedor.getBytesLoaded()/this.contenedor.getBytesTotal())*100;
if(!isNan(percent)){
trace(percent+"% loaded");
}else{
trace("0% loaded");
}
if(percent == 100){
delete this.onEnterFrame;
gotoAndPlay(3); // here I make the music start playing
}
}
And here's the moment when I load the other 3 SWFs, and when the music stops playing:
Code:
switch (pelicula) {
case 1:
this.createEmptyMovieClip("holder2",2);
holder2.loadMovie("arriba2.swf");
this.createEmptyMovieClip("holder3",3);
holder3.loadMovie("arriba3.swf");
this.createEmptyMovieClip("holder4",4);
holder4.loadMovie("arriba4.swf");
case 2:
this.createEmptyMovieClip("holder1",1);
holder1.loadMovie("arriba1.swf");
this.createEmptyMovieClip("holder3",3);
holder3.loadMovie("arriba3.swf");
this.createEmptyMovieClip("holder4",4);
holder4.loadMovie("arriba4.swf");
case 3:
this.createEmptyMovieClip("holder1",1);
holder1.loadMovie("arriba1.swf");
this.createEmptyMovieClip("holder2",2);
holder2.loadMovie("arriba2.swf");
this.createEmptyMovieClip("holder4",4);
holder4.loadMovie("arriba4.swf");
case 4:
this.createEmptyMovieClip("holder1",1);
holder1.loadMovie("arriba1.swf");
this.createEmptyMovieClip("holder2",2);
holder2.loadMovie("arriba2.swf");
this.createEmptyMovieClip("holder3",3);
holder3.loadMovie("arriba3.swf");
}
this.onEnterFrame=function(){
//trace the percentage of the movie that has loaded
switch (pelicula) {
case 1:
percenta=(this.holder2.getBytesLoaded()/this.holder2.getBytesTotal())*100;
percentb=(this.holder3.getBytesLoaded()/this.holder3.getBytesTotal())*100;
percentc=(this.holder4.getBytesLoaded()/this.holder4.getBytesTotal())*100;
case 2:
percenta=(this.holder2.getBytesLoaded()/this.holder2.getBytesTotal())*100;
percentb=(this.holder3.getBytesLoaded()/this.holder3.getBytesTotal())*100;
percentc=(this.holder4.getBytesLoaded()/this.holder4.getBytesTotal())*100;
case 3:
percentb=(this.holder1.getBytesLoaded()/this.holder1.getBytesTotal())*100;
percenta=(this.holder2.getBytesLoaded()/this.holder2.getBytesTotal())*100;
percentc=(this.holder4.getBytesLoaded()/this.holder4.getBytesTotal())*100;
case 4:
percentc=(this.holder1.getBytesLoaded()/this.holder1.getBytesTotal())*100;
percenta=(this.holder2.getBytesLoaded()/this.holder2.getBytesTotal())*100;
percentb=(this.holder3.getBytesLoaded()/this.holder3.getBytesTotal())*100;
}
if(!isNan(percenta)){
//trace(percenta+"% loaded, " + percentb+"% loaded, " + percentc+"% loaded, " + );
}else{
trace("0% loaded");
}
if((percenta == 100) && (percentb == 100) && (percentc == 100)){
delete this.onEnterFrame;
gotoAndPlay(11);
}
}
Is that the reason for the music to stop? The first movie being overwritten by the new ones, I mean...
Thanks a lot in advance,
Angel.
How Do I Load Two External Swf's In Empty Movie Clips At The Same Time? Help...
Sorry if the title is a bit confusing.
OK, I have a swf of a menu that I need to load when a link is selected. All external pages I have at the moment load into one empty movie clip in a file called index.swf. However, I need my menu to load in another (side nav) movie clip as specfic links are selected from another navigation area. Right now, I have a news scroller, which is part of my index.swf page so it currently does not change as the external swf's load. But, I'd like that to change once links from another bottom navigation menu in the index.swf are clicked instead of just loading the external files in one place, I'd like the menu to load into its own side movie clip accordingly.
Does this make sense? When a button from the already existing nav on index.swf is selected, I need 2 external swf's (the new side menu to replace the news as well as the existing main movie clip) to load instead of just one.
The solution would seem to be a simple, but I'm a novice (steadily learning), so I'm having trouble figuring it out.
Also, existing movie clip that loads the swf's into index.swf covers the height and width of index.swf like Kirupa's full site tutorial (as my site is a full site as well).
To relate my problem to that tutorial, which I followed feverishly, I have two nav area's instead of one, one exists (is constant) on index.swf, the other will load into a new movie clip as a side nav menu.
I'm using MX (not 2004) by the way.
Any help is much appreciated.
Thanks
[MX2004] Creating Multiple Empty Movie Clips.
At the same time.
Can you do that?
I tried it and it just doesnt work, it creates the first one but the other five dont work and createTextField wont work after the first createmovieclip.
Why? lol
How Do I Load Two External Swf's In Empty Movie Clips At The Same Time? Help...
Sorry if the title is a bit confusing.
OK, I have a swf of a menu that I need to load when a link is selected. All external pages I have at the moment load into one empty movie clip in a file called index.swf. However, I need my menu to load in another (side nav) movie clip as specfic links are selected from another navigation area. Right now, I have a news scroller, which is part of my index.swf page so it currently does not change as the external swf's load. But, I'd like that to change once links from another bottom navigation menu in the index.swf are clicked instead of just loading the external files in one place, I'd like the menu to load into its own side movie clip accordingly.
Does this make sense? When a button from the already existing nav on index.swf is selected, I need 2 external swf's (the new side menu to replace the news as well as the existing main movie clip) to load instead of just one.
The solution would seem to be a simple, but I'm a novice (steadily learning), so I'm having trouble figuring it out.
Also, existing movie clip that loads the swf's into index.swf covers the height and width of index.swf like Kirupa's full site tutorial (as my site is a full site as well).
To relate my problem to that tutorial, which I followed feverishly, I have two nav area's instead of one, one exists (is constant) on index.swf, the other will load into a new movie clip as a side nav menu.
I'm using MX (not 2004) by the way.
Any help is much appreciated.
Thanks
Aligning Dynamically Loaded Images Within Empty Movie Clips
Hey Guys,
this might be a stupid question, but if I create an empty movie clip and dynamically load a jpg into it, is there a way to align it to the right? At the moment the image's top left corner will be put at the top left corner of the emptymovieclip. I want to put the top right corner of the jpg and align it right inside the movie clip. Is that possible?
Matt
AttachMovie - Looping Thru An Array To Attach 6 Movie Clips Into An Empty Clip
Heres my issue...
Im loading in 6 different external icon button images using an XML file into an movieclip. well now i dont want external images to load from an xml file, i want the images to be inside flash in the library. I gave them a linkage name and made an array of them called menuIcons.
how do i get my icon images to load into flash without loading external images from an xml file...
heres my code..
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
numOfItem = nodes.length;
for (var i=0; i<numOfItem; i++)
{
menuIcons = ["healthySkin", "environMoist", "lowerSkin", "drySkin", "waterInfusion", "healthyCellular"];
var t = home.attachMovie("item", "item" + i, i + 1);
t.angle = i * ((Math.PI * 2)/numOfItem);t.onEnterFrame = mover;
t.nameClip = (nodes[i].attributes.nameClip);
t.content = (nodes[i].attributes.content);
t.icon.inner.loadMovie(nodes[i].attributes.image);t.icon.onRollOver = over;
t.icon.onRollOut = out;
t.icon.onRelease = released;
}
}
thanks
slalonde44
Heirarchy
hey,
I'm trying to load a slider navigation MC into an empty MC in another movie and the slider is not working. I know you have to refer back to the main movie when doing this _parent. but I'm not sure how to throw it into the code as it is now.
scrollpos = getProperty("/scrollbar", _x);
postoset = Number((scrollpos*-9.9))+89;
setProperty("/content_w_mask/content", _x, postoset);
I'm pretty sure this is where I would have to tell the loaded MC to refer back to is't parent. But not quite sure.
MC Heirarchy
I am working on a OSX based interface.
How do I move one MC to the top when I click on it ..
you can see once you open the "finder"
and then the dTunes .. if you click the Finder again,
it remains on the bottom.
for now they are on different layers,
Should they be the same layer?
Should I create the movies instances with AS?,
rather then have the button action move an existing clip to a different
frame, making the content visable.
Did I ask to many questions?
here is what I have so far:
http://enstudios.com/space/osx
Heirarchy
hey,
I'm trying to load a slider navigation MC into an empty MC in another movie and the slider is not working. I know you have to refer back to the main movie when doing this _parent. but I'm not sure how to throw it into the code as it is now.
scrollpos = getProperty("/scrollbar", _x);
postoset = Number((scrollpos*-9.9))+89;
setProperty("/content_w_mask/content", _x, postoset);
I'm pretty sure this is where I would have to tell the loaded MC to refer back to is't parent. But not quite sure.
|