Cleaning Out Unused Symbols?
Hey... I have a whole slew of fla files that I built one on top of another - that is, creating one, then using it as the basis for the next.... Consequently, as time went by there are dozens of unused symbols in the libraries.... is there a quick and easy way to simply get rid of unused/unpublished symbols - just so I can clean these files up? Any help would be most appreciated !
FlashKit > Flash Help > Flash Newbies
Posted on: 08-11-2003, 04:36 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Deleting All Unused Symbols In The Lib
Hello! When experimenting with flash und tweens, flash mx puts a lot of "Tween xx"-Symbols in the lib. So before publishing a movie, I want to delete all the unused symbols in the lib. How is it done? Okay, you can start deleting them one by one (and when you see that the "delete instances" button is enable you see that you should not delete them), but isn't there an easier way?
Martho
Removing Unused Symbols
Hey, I'm trying to remove some of the unused symbols in my library... but I can't find an option to do so in flash mx... anyone know if this affects the overall size of the swf?
also, i need help optimizing/reducing for my site...
heres the site to view what i have so far (7 mbs)
jeweladdict.com
i've created a low quality where hte mp3 is at like 8kbps, but it sucks
the .fla is at jeweladdict.com/touchpreload.fla
any suggestions? this was my first time creating a flash movie
thanks for hte feedback and help
How To Delete Unused Symbols In Library?
Hello! After making a movie a lot of unused symbols are still in the library. How can I delete them without deleting every single symbol and then have a look if it was used?
Old, Unused Images
I am sure that this is a very simple question. I have images that I have been playing around with in Flash while building a site. If I bring an edited version of an image in and then convert it to a graphic, it makes me rename it to something unique. Is there a way to override all these old images or some way to get rid of all the old ones that are in Flash?
Thanks so much for your help!
Ketchme
Remove Unused Fonts
For filesize-matter the following question: I used 2 fonts in my movie, but when I look at the size-report I see there are 2 more fonts embedded in the movie, but I can't find where they are in my movie (I am convinced they are not there). Is there a way to remove these embedded redundant fonts?
Deleting Unused Items
Hi guys,
I wanted to make my FLA's lighter (size) so i decided to delete unused items by going to the library panel, and doing so.. however, by deleting the unused items, IT MADE MY FLA EVEN BIGGER! Go ahead, test it on your FLA's!
I know, it's weird.. someone tell me why
Unused Library Items....
What happens to unused library items? Do they get exported into the swf as well? If so, where in the movie are they exported? The first frame? I know ideally that you would not have unused library items, but in this case I have items that are not used in the movie itself instead they are used for future editing of the movie.
Unused Library Items
are unused library items discarded when a movie is published, or do I have to clean it out myself?
Thanks
Removing Unused Audio?
I inherited a huge Flash file with dozens of sounds in the library. Only a few of the sounds are actually used so I want to discard the unused sounds.
How can I tell if an audio file stored in a library is currently being used?
Thanks.
Finding Unused Action
Our new site is nearly completed, when I preview I get a warning. No errors, just a warning.
No big deal as everything works as it should, but I would like to clear it out if possible.
When I started the site, I was on AS2, then switched to AS3. I must have had a script on a button at first, and now I get this warning:
WARNING: Actions on button or MovieClip instances are not supported in ActionScript 3.0. All scripts on object instances will be ignored.
I have checked every button, link etc I use and none have any scripts on them, and everything works.
Is this a default warning or is there a way to clear it out?
Attach Code
WARNING: Actions on button or MovieClip instances are not supported in ActionScript 3.0. All scripts on object instances will be ignored.
Finding Unused Objects
Is there an easy way to find out which objects in the library are no longer being used in a flash 8 movie?
Remove Unused Items
Hello , Does anybody know that how to remove all unused items from library?
Optimizing Unused Tweens
In the process of creating a Flash application, it is trial an error as to making the program work right. I noticed that everytime I make a tween it is stored in my library. Some of them will never be used and were just part of the editing process. How do I know which tweens are being used in the movie, and which are not? Is there some way that I can remove the tweens that aren't used without accidentally deleting the ones that are?
Select Unused Items?
hi all,
i have quite a sizeable flash movie. im trying to slim down the fla, so have used the 'select unused items' button which selected about 40 items which i duly deleted. there is a stack more stuff that isnt being used, but when i 'select unused items', they arent selected, even though they are not being used anywhere. has anyone had any experience of this?
cheers
D
How Important Is It To Delete Unused Items?
hi,
I have about 20 swfs that I published without "selecting unused" and deleting those items. SHould I go back and delete unused items from my files and republish?
cheers,
jen
Unused Fonts In Generated Report
Hi,
My file turned out too large, so I generated a report and found two fonts that I'm no longer using in the file. How can I take these out of the file?
Thanks.
Dan
Does Flash Import Unused Classes?
Like a lot of you I have a growing library of custom components and util classes. Now what I'm wondering is if I use a class which imports a number of other classes(an obvious one would be a custom tweening util class importing Robert Penner’s AS2.0 classes), and some of these imported classes are never used in the published file, are they still added to the published movie increasing its file size? If so WHY?!
Sorry if this has been asked before! I did do a search first.
Cleaning Up For GC
Hi. So, I'm trying to recursively clean up some objects so they can be garbage collected, and I have the following code in one class..
ActionScript Code:
// Destroy all references so GC can collect
public function destroy():void {
while(numChildren > 0) {
var object = getChildAt(0);
if (object is IDestroyable) {
object.destroy();
}
removeChild(object);
}
removeEventListener(Event.ENTER_FRAME, drawLine);
spriteList = null;
_startPoint = null;
_endPoint = null;
addEventListener(Event.ENTER_FRAME,function () {trace("Still alive =( ")},false,0,true);
}
and of course, it is still alive, even after an obvious GC has occurred (watching a memory graph). spriteList was an array of sprites and with start/end Points are the only object references in the class. Am I doing something incorrectly?
Subtle memory leaks are annoying
Editing Graphic Symbols By Copying And Pasting To Make Slightly Dif Symbols
Hi!
I am using flash to create moving people symbols. I created a "singular person" symbol and saved it, I then copyed a few to make a "bunch of people" symbol, when I go to edit these copyed and pasted symbols each saved symbol changes. Also I am saving them as graphic symbols at the moment.
thanks,
Helen
Cleaning Library
Hey Everybody,
I want to clear out my library of all the junk that I'm not using in my movie. Is there a way to do it without manually doing it myself? I'm afraid if I do it I will delete stuff I need. (It never fails when I try.)
I'm using Flash MX.
THANKS!
Christina
Cleaning Up Code...
Hi i'm trying to reduce the number of lines in my code and would like to go from this: -
for (i=0;i<jobnos_array.length;i++){
trace (jobnos_array[i])
}
for (i=0;i<jobtitles_array.length;i++){
trace (jobtitles_array[i])
}
for (i=0;i<location_array.length;i++){
trace (jobtitles_array[i])
}
Etc etc
to this: -
for (i=0;i<jobnos_array.length;i++){
trace (jobnos_array[i])
trace (jobtitles_array[i]
trace (location_array[i]
Etc etc
}
But apparently its not that easy! All arrays are exactly the same size, but thats irrelevant I would just like to know how to tie multiple commands under the same 'for' statement rather than repeating it each time. Thanks
Help With Cleaning Up Code
What I'm trying to do is have an progress indicator for 10 or more sounds that play one after the other in different frames. I need help with making the code more simple because if I have 10 sounds, the "if" part becomes very confusing. Also how can I trace the total duration of 10+ sounds in an easy way. The code otherwise runs perfectly.
Code:
for (i=1; i<4; i++) {
_root["mp3sound0"+i] = new Sound();
_root["mp3sound0"+i].attachSound("sound0"+i+".mp3");
}
mp3sound01.start();
mp3sound01.onSoundComplete = function() {
nextFrame();
};
this.onEnterFrame = function() {
if (((mp3sound01.duration)+(mp3sound02.duration)) != ((mp3sound01.position)+(mp3sound02.position))) {
percentage = Math.round(((((mp3sound01.position)+(mp3sound02.position))*100)/((mp3sound01.duration)+(mp3sound02.duration)))*10)/10;
indicator._x = bar._x+((bar._width/100)*percentage);
}
};
stop();
trace(mp3sound01.duration);
trace(mp3sound02.duration);
trace((mp3sound01.duration)+(mp3sound02.duration));
Cleaning Up The Library
If I have converted a jpg into a symbol can I remove the original jpg from the library? I am trying to clean things up a bit but don't want to mess everything up.
Also is there a way to change my jpg's into vector graphics? I know with a bitmap you can use the trace bitmap feature and this will reduce file size, I am wanting to do this with all my jpgs. Is it possible? How?
Clocks Need Cleaning
Hey -
I'm making a new site that's time oriented. I've found around 15 or so flash clocks that need someone to go inside them and reset to 12 hours cycles (non-military) and add my logo.
Where might I find someone to do this for a few bucks...say $10?
Thanks
Cleaning Things Up
Is there a way to clean out the library? I have a lot of items in my library but i know that i haven't used all of them in the flash file. I was trying to clean it up just for organization purposes. How do i tell which objects are being used by the file and which ones are unnecessary? Thanks!
[F8] Cleaning Your Library?
Possibly a stupid question... but is there a way to see what's actually being used in your library? I have alot of stuff in there and obviously I wanna cut down what I don't need for better performance. Is there any easy way to do this basically?
Cleaning Out The Library
I've been hearing and reading conflicting info... Does deleting unused library items help optimize a .swf? Or, is Flash smart enough to only take what it needs?
Thanks in advance.
Help Cleaning This Code
I'm relatively new to AS3 and learning. I would like to know how to reduce this code by maybe using arrays or loops? and still work the same. I'm using Tweener here. I pasted 2 of 6 buttons actions and if I wanted to make 6 or more buttons seems like alot of code?
Code:
import caurina.transitions.*;
but1.addEventListener(MouseEvent.ROLL_OVER, PopIn1);
but1.addEventListener(MouseEvent.ROLL_OUT, PopOut1);
function PopIn1(e:MouseEvent):void {
Tweener.addTween(glow1, {alpha:1,time:1,delay:0, transition:"easeInOutSine"});
Tweener.addTween(arrow1, {alpha:1,time:0.5,delay:0, transition:"easeInOutSine"});
Tweener.addTween(text1, {alpha:1,time:0.5,delay:0.8, transition:"easeInOutSine"});
Tweener.addTween(step1, {scaleX:1, scaleY:1,delay:0.61,time:0.5,transition:"easeInOut Sine"});
Tweener.addTween(logo, {alpha:0,time:0.5,delay:0.5, transition:"easeInOutSine"});
Tweener.addTween(nitrologo, {alpha:1,time:0.5,delay:0.7, transition:"easeInOutSine"});
lines.sublines.play()
step1.lines.sublines.play()
arrow1.gotoAndPlay(2);
}
function PopOut1(e:MouseEvent):void {
Tweener.addTween(step1, {scaleX:0, scaleY:0,time:0.5,transition:"easeInOutSine"});
Tweener.addTween(logo, {alpha:1,time:0.5,delay:0, transition:"easeInOutSine"});
Tweener.addTween(glow1, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
Tweener.addTween(arrow1, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
Tweener.addTween(text1, {alpha:0,time:0.5,delay:0.3, transition:"easeInOutSine"});
Tweener.addTween(nitrologo, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
lines.sublines.stop()
step1.lines.sublines.stop()
}
but2.addEventListener(MouseEvent.ROLL_OVER, PopIn2);
but2.addEventListener(MouseEvent.ROLL_OUT, PopOut2);
function PopIn2(e:MouseEvent):void {
Tweener.addTween(text2, {alpha:1,time:0.5,delay:0.8, transition:"easeInOutSine"});
Tweener.addTween(glow2, {alpha:1,time:1,delay:0, transition:"easeInOutSine"});
Tweener.addTween(arrow2, {alpha:1,time:0.5,delay:0, transition:"easeInOutSine"});
Tweener.addTween(step2, {scaleX:1, scaleY:1,delay:0.5,time:0.5,transition:"easeInOutS ine"});
Tweener.addTween(logo, {alpha:0,time:0.5,delay:0, transition:"easeInOutSine"});
Tweener.addTween(nitrologo, {alpha:1,time:0.5,delay:0.65, transition:"easeInOutSine"});
arrow2.gotoAndPlay(2);
}
function PopOut2(e:MouseEvent):void {
Tweener.addTween(step2, {scaleX:0, scaleY:0,time:0.5,transition:"easeInOutSine"});
Tweener.addTween(logo, {alpha:1,time:1,delay:0, transition:"easeInOutSine"});
Tweener.addTween(glow2, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
Tweener.addTween(arrow2, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
Tweener.addTween(text2, {alpha:0,time:0.5,delay:0.3, transition:"easeInOutSine"});
Tweener.addTween(nitrologo, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
}
Need Some Help Cleaning This Code
Hey all, I can't say that I'm new to AS3, I've been working with it alot, and doing loads of stuff with it, and it's great so far, but one thing I have always had trouble with, is the amount of code I use. I'm pretty sure there is a cleaner, simpler way of doing things, but I guess I'll have to learn a bit at a time.
So I'll start here.
This is part of the code I'm using for a little experiment that I've put together. It works fine, just needs cleaning.
There is a single movieclip on the stage, and to start, it is duplicated to 4 childs. These childs have 4 seperate rotations (0,90,180,270) and then they are duplicated lots of times on those settings, using a timer.
I was sure that I saw a simpler way of doing this somewhere, but I really can't remember where I saw it, and I haven't the foggiest what I need to look for, simply because I don't know what it's called.
I'll also add the fla file, just in case.
Any help would be awesome! Thanks guys!
ATT: Light_Rotation.fla
Code:
function createTrailBall(e:Event):void {
// Create Child1 and add info
var trailBall1:Orb=new Orb();
trailBall1.x = trailPosition;
trailBall1.y = trailPosition;
trailBall1.rotation = 0;
// Create Child2 and add info
var trailBall2:Orb=new Orb();
trailBall2.x = trailPosition;
trailBall2.y = trailPosition;
trailBall2.rotation = 90;
// Create Child3 and add info
var trailBall3:Orb=new Orb();
trailBall3.x = trailPosition;
trailBall3.y = trailPosition;
trailBall3.rotation = 180;
// Create Child4 and add info
var trailBall4:Orb=new Orb();
trailBall4.x = trailPosition;
trailBall4.y = trailPosition;
trailBall4.rotation = 270;
[color="DimGray"]
//Start the next function for rotation and alpha changes
trailBall1.addEventListener(Event.ENTER_FRAME,animateTrailBall);
trailBall2.addEventListener(Event.ENTER_FRAME,animateTrailBall);
trailBall3.addEventListener(Event.ENTER_FRAME,animateTrailBall);
trailBall4.addEventListener(Event.ENTER_FRAME,animateTrailBall);
//Add Childs to stage
addChildAt(trailBall1,0);
addChildAt(trailBall2,0);
addChildAt(trailBall3,0);
addChildAt(trailBall4,0);
}
// Function for changeing Childs on stage
function animateTrailBall(e:Event):void {
e.target.rotation += rotationSpeed;
e.target.alpha -= 0.01;
if (e.target.alpha <= 0) {
e.target.removeEventListener(Event.ENTER_FRAME,animateTrailBall);
removeChild((MovieClip)(e.target));
}
}
Class Cleaning
I'm loading a movieClip that has a class attached to it which extends MovieClip.
Inside this class I create another class instance in a reference variable.
Now if I delete this movieClip prom the stage will it delete the class attaches to it and all the variables in it, plus the reference variable to the instance class inside that attached class?
Hope this makes sence
Thanks
Cleaning Up This Loop.
I got a rather long and uncool loop that I'd like to see shortened so it's just one if statement..
ActionScript Code:
function sortCards() {
//Associates 10 picture frames with the different cards.
for (i=0; i<20; i++) {
if (pictureNum[i] == 1 || pictureNum[i] == 2) {
frame = 2;
} else if (pictureNum[i] == 3 || pictureNum[i] == 4) {
frame = 3;
} else if (pictureNum[i] == 5 || pictureNum[i] == 6) {
frame = 4;
} else if (pictureNum[i] == 7 || pictureNum[i] == 8) {
frame = 5;
} else if (pictureNum[i] == 9 || pictureNum[i] == 10) {
frame = 6;
} else if (pictureNum[i] == 11 || pictureNum[i] == 12) {
frame = 7;
} else if (pictureNum[i] == 13 || pictureNum[i] == 14) {
frame = 8;
} else if (pictureNum[i] == 15 || pictureNum[i] == 16) {
frame = 9;
} else if (pictureNum[i] == 17 || pictureNum[i] == 18) {
frame = 10;
} else if (pictureNum[i] == 19 || pictureNum[i] == 20) {
frame = 11;
}
_root["card"+i].pictureNum = frame;
}
}
Cleaning Up Listeners.
Hi,
Got a class which instantiates another class multiple times. To each instance it adds 4 event listeners - onReady, onMinimised, onSelect and onClosed.
When the onClosed event is fired it destroys the instance, but is there a nice way to clear up the 4 listeners?
Thanks
Cleaning Up Code
I have this function with allot of if's statements, I'm wondering if there is a way to clean it up so it is more efficient, and less lines of code.
ActionScript Code:
function onBtnDown():void {
var imageBox:MovieClip = this["box_"+btnRef];
MovieClip(this.parent.parent).portRefPos = ((myPageRef*5) - 5) + btnRef;
if (MovieClip(this.parent.parent).portOld != imageBox) {
MovieClip(this.parent.parent).portOld = imageBox;
if (MovieClip(this.parent.parent).myMovieSection != MovieClip(this.parent.parent).portSelection) {
MovieClip(this.parent.parent).mainContent_mc.gotoAndPlay("Unload");
MovieClip(this.parent.parent).myMovieSection = MovieClip(this.parent.parent).portSelection;
} else if (MovieClip(this.parent.parent).myMovieSection == MovieClip(this.parent.parent).portSelection) {
if (MovieClip(this.parent.parent).portRefPos != MovieClip(this.parent.parent).mainContent_mc.mainContent_mc.refPos) {
MovieClip(this.parent.parent).mainContent_mc.mainContent_mc.gotoAndPlay("Current Reload");
}
}
} else if (MovieClip(this.parent.parent).portOld == imageBox) {
if (MovieClip(this.parent.parent).myMovieSection != MovieClip(this.parent.parent).portSelection) {
MovieClip(this.parent.parent).mainContent_mc.gotoAndPlay("Unload");
MovieClip(this.parent.parent).myMovieSection = MovieClip(this.parent.parent).portSelection;
} else if (MovieClip(this.parent.parent).myMovieSelection == MovieClip(this.parent.parent).portSelection) {
if (MovieClip(this.parent.parent).portRefPos != MovieClip(this.parent.parent).mainContent_mc.mainContent_mc.refPos) {
MovieClip(this.parent.parent).mainContent_mc.mainContent_mc.gotoAndPlay("Current Reload");
}
}
}
}
Help Cleaning A File
Hey all,
I have a question for you getting into Geom/Trig and getting a dynamic equation to work with a geoboard I'm making. It's still kind of in the beginning stages, and I have the initial band laying more or less working, but the "wrap" effect is a little screwy, and I'm not really sure what's going on.
Basically, if you choose to lay a band at a 45º angle, it will work just fine. Get outside of that, and it gets a little screwy, but still workable. The biggest problem is that (based on the bass-ackerds Flash Cartesian Plane) if you run a line to quadrant 2 || 3, then it reverses the "wrap around" code, and so it wraps inwards instead outwards.
So the question is, is there anything you guys can suggest to get this working all the time? And possibly clean up my Math a bit as well... I haven't done serious Geom/Trig in about 15 years or so, and I don't know that what I am attempting is actually the best way to go about what I am trying to do.
The file is below, but here's the "problematic" code:
ActionScript Code:
function findTanLine(pinNum:Number,lastPoint:Boolean):Object {
var tanLineInfo:Object = new Object;
var point1:Point;
var point2:Point;
var angle:Number;
var perpendicularAngle:Number;
var oppositeLength:Number;
var adjacentLength:Number;
var curveXLength:Number;
var curveYLength:Number;
var radius:Number = 5;
var invert:Boolean;
if (!lastPoint) { //used to determine if it's the last "point" in the band. This is only really necessary
//to determine orientation, so that I can calculate the correct control points in the correct order.
point1 = bandArray[bandNumber][pinNum];
point2 = bandArray[bandNumber][pinNum+1];
} else if (lastPoint) {
point1 = bandArray[bandNumber][pinNum];
point2 = bandArray[bandNumber][1]; //this is the "first" point, so it also acts as the "closing" point.
}
var pointX:Number = point2.x-point1.x; //used to triangulate so I can get the X/Y lengths and get the angle.
var pointY:Number = point2.y-point1.y; //used to triangulate so I can get the X/Y lengths and get the angle.
angle = Math.atan2(pointY,pointX); //Gets the angle of the band
trace(angle+": Angle");
perpendicularAngle = angle+((3*Math.PI)/2); //gets the perpendicular bisector. I THINK I could use PI/2 as well, but no tested.
oppositeLength = radius*Math.sin(perpendicularAngle); //gets the X/Y of the tangential.
adjacentLength = radius*Math.cos(perpendicularAngle);
curveXLength = radius*Math.sin(angle); //this gets the X/Y of an extension of the original line.
curveYLength = radius*Math.cos(angle);
trace((point2.x+curveXLength)+": DeltaX;
"+(point2.y+curveYLength)+": DeltaY;");
tanLineInfo.pointOneX = point1.x+adjacentLength; //X of start of Tangent line
tanLineInfo.pointOneY = point1.y+oppositeLength; //Y of start of Tangent line
tanLineInfo.pointTwoX = point2.x+adjacentLength; //X of end of the Tangent line
tanLineInfo.pointTwoY = point2.y+oppositeLength; //Y of end of the Tangent line
//This is the part that I'm REALLY not sure about. This is to return the build points so the line curves around
//the "pins". Something is wrong with it, and it needs to be cleaned and/or simplified. As things are, on the
//first pass, if the change in X (pointX) is negative, then it seems to invert the "curve" points, and so it curves
//inward around the pin, instead of outward around the pin. It's also dependant on whether or not it's the last point.
//I think the idea is sound, but the practice is wrong...
if (!lastPoint && angle>0) {
tanLineInfo.curveXPoint = point2.x+curveXLength;
tanLineInfo.curveYPoint = point2.y+curveYLength;
tanLineInfo.controlCurve1X = point2.x-oppositeLength+curveXLength;
tanLineInfo.controlCurve1Y = point2.y-adjacentLength+curveYLength;
tanLineInfo.controlCurve2X = point2.x+oppositeLength+curveXLength;
tanLineInfo.controlCurve2Y = point2.y+adjacentLength+curveYLength;
} else if (!lastPoint && angle<=0) {
tanLineInfo.curveXPoint = point2.x-curveXLength;
tanLineInfo.curveYPoint = point2.y-curveYLength;
tanLineInfo.controlCurve1X = point2.x+oppositeLength-curveXLength;
tanLineInfo.controlCurve1Y = point2.y+adjacentLength-curveYLength;
tanLineInfo.controlCurve2X = point2.x-oppositeLength-curveXLength;
tanLineInfo.controlCurve2Y = point2.y-adjacentLength-curveYLength;
} else if (lastPoint && angle>0) {
tanLineInfo.curveXPoint = point2.x-curveXLength;
tanLineInfo.curveYPoint = point2.y-curveYLength;
tanLineInfo.controlCurve1X = point2.x+oppositeLength-curveXLength;
tanLineInfo.controlCurve1Y = point2.y+adjacentLength-curveYLength;
tanLineInfo.controlCurve2X = point2.x-oppositeLength-curveXLength;
tanLineInfo.controlCurve2Y = point2.y-adjacentLength-curveYLength;
} else if (lastPoint && angle<=0) {
tanLineInfo.curveXPoint = point2.x+curveXLength;
tanLineInfo.curveYPoint = point2.y+curveYLength;
tanLineInfo.controlCurve1X = point2.x-oppositeLength+curveXLength;
tanLineInfo.controlCurve1Y = point2.y-adjacentLength+curveYLength;
tanLineInfo.controlCurve2X = point2.x+oppositeLength+curveXLength;
tanLineInfo.controlCurve2Y = point2.y+adjacentLength+curveYLength;
}
return tanLineInfo; //return the Object with the info bound to it.
}
This snippet is just the function that returns all the dynamic drawing points by binding the variables to an object, and just returning that object. Like I said, this is still early on in the process, and I haven't actually classed things out yet, I just wanted to toss this out there and see if anyone with a better grasp of the Geom/Trig than I has any better ideas on how to tackle this.
Thanks in advance for looking!
Cleaning Up Code
Worked on this for a while, does the jpb, but because of the way I have done it, I can't get any removeMovieClip() functions to work on the new instances . . .
Need it cleaned up an in a way that I can use a removeMovieClip on it and have it actually remove them all.
Very Tired an need a new pair of eyes on this.
ActionScript Code:
/*********** Row One ***********/function row_one() { X = 400; Y = 340; scale = 100; for (i; i<3; i++) { duplicateMovieClip(_root.easy, "row_one"+i, i); setProperty ("row_one"+i, _x, X); setProperty ("row_one"+i, _y, Y); setProperty ("row_one"+i, _xscale, scale); setProperty ("row_one"+i, _yscale, scale); i++; X += 165; } }/*********** Row Two ***********/function row_two() { X = 205; Y = 410; scale = 125; for (ii; ii<3; ii++) { duplicateMovieClip(_root.easy, "row_two"+i, i); setProperty ("row_two"+i, _x, X); setProperty ("row_two"+i, _y, Y); setProperty ("row_two"+i, _xscale, scale); setProperty ("row_two"+i, _yscale, scale); i++; X += 195; } }/************* Row Three *************/function row_three() { X = 175; Y = 500; scale = 150; for (iii; iii<3; iii++) { duplicateMovieClip(_root.easy, "row_three"+i, i); setProperty ("row_three"+i, _x, X); setProperty ("row_three"+i, _y, Y); setProperty ("row_three"+i, _xscale, scale); setProperty ("row_three"+i, _yscale, scale); i++; X += 225; } }row_one();row_two();row_three();
I have almost the same code in three different frames, just using different instabnces as the basis for the duplication, and another layer that has a timer, when timer runs out, takes you to the scoreboard, now all was working well before i changed it to duplicate function, I just pulled them in from the library, but they weren't all the same size an crap (for perspective) But now ehn I get to the scoreboard, the darn things are still running.
Need to kill em off somehow.
Thanx in advance.
Cleaning The Stage?
Hello, everyone. I need some help. I have a stage that's filled with dynamically generated isometric objects [ in the shape of a smiley, placed according to an array ], and when i click a button, i would like the stage to be cleared, then another frame with another isometric code and another array to load.
The problem i am facing now is that the items positionned from the smiley are still on the stage if the next array is smaller than the previous one. Do you guys/gals know of any way i could clear the stage before going on the next frame? Currenlty, i tried unloadMovieNum(depth) in between with this code:
Code:
n = 50;
onEnterFrame = function(){
trace(n);
n--;
unloadMovieNum(n);
if ( n<=0){
nextFrame();
} else { stop(); }
}
What happens is that it clears the stage, but doesnt load anything in teh following frame.
I hope that i was clear. If any confusion prevails, please answer the questions that linger in your minds.
Thank you in advance.
Cleaning Up Arrays
I was wondering how to check an array for a blank index and removing it.
Right now I have this:
ActionScript Code:
function cleanArray (it) { for (var i = 0; i < it.length; i++) { if (it [i] == undefined) { it.splice (i, 1); } } }
But it doesnt seem t work for me. What do you usually use?
Help Cleaning This Code
I'm relatively new to AS3 and learning. I would like to know how to reduce this code by maybe using arrays or loops? and still work the same. I'm using Tweener here. I pasted 2 of 6 buttons actions and if I wanted to make 6 or more buttons seems like alot of code?
import caurina.transitions.*;
but1.addEventListener(MouseEvent.ROLL_OVER, PopIn1);
but1.addEventListener(MouseEvent.ROLL_OUT, PopOut1);
function PopIn1(e:MouseEvent):void {
Tweener.addTween(glow1, {alpha:1,time:1,delay:0, transition:"easeInOutSine"});
Tweener.addTween(arrow1, {alpha:1,time:0.5,delay:0, transition:"easeInOutSine"});
Tweener.addTween(text1, {alpha:1,time:0.5,delay:0.8, transition:"easeInOutSine"});
Tweener.addTween(step1, {scaleX:1, scaleY:1,delay:0.61,time:0.5,transition:"easeInOut Sine"});
Tweener.addTween(logo, {alpha:0,time:0.5,delay:0.5, transition:"easeInOutSine"});
Tweener.addTween(nitrologo, {alpha:1,time:0.5,delay:0.7, transition:"easeInOutSine"});
lines.sublines.play()
step1.lines.sublines.play()
arrow1.gotoAndPlay(2);
}
function PopOut1(e:MouseEvent):void {
Tweener.addTween(step1, {scaleX:0, scaleY:0,time:0.5,transition:"easeInOutSine"});
Tweener.addTween(logo, {alpha:1,time:0.5,delay:0, transition:"easeInOutSine"});
Tweener.addTween(glow1, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
Tweener.addTween(arrow1, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
Tweener.addTween(text1, {alpha:0,time:0.5,delay:0.3, transition:"easeInOutSine"});
Tweener.addTween(nitrologo, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
lines.sublines.stop()
step1.lines.sublines.stop()
}
but2.addEventListener(MouseEvent.ROLL_OVER, PopIn2);
but2.addEventListener(MouseEvent.ROLL_OUT, PopOut2);
function PopIn2(e:MouseEvent):void {
Tweener.addTween(text2, {alpha:1,time:0.5,delay:0.8, transition:"easeInOutSine"});
Tweener.addTween(glow2, {alpha:1,time:1,delay:0, transition:"easeInOutSine"});
Tweener.addTween(arrow2, {alpha:1,time:0.5,delay:0, transition:"easeInOutSine"});
Tweener.addTween(step2, {scaleX:1, scaleY:1,delay:0.5,time:0.5,transition:"easeInOutS ine"});
Tweener.addTween(logo, {alpha:0,time:0.5,delay:0, transition:"easeInOutSine"});
Tweener.addTween(nitrologo, {alpha:1,time:0.5,delay:0.65, transition:"easeInOutSine"});
arrow2.gotoAndPlay(2);
}
function PopOut2(e:MouseEvent):void {
Tweener.addTween(step2, {scaleX:0, scaleY:0,time:0.5,transition:"easeInOutSine"});
Tweener.addTween(logo, {alpha:1,time:1,delay:0, transition:"easeInOutSine"});
Tweener.addTween(glow2, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
Tweener.addTween(arrow2, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
Tweener.addTween(text2, {alpha:0,time:0.5,delay:0.3, transition:"easeInOutSine"});
Tweener.addTween(nitrologo, {alpha:0,time:0.3,delay:0, transition:"easeInOutSine"});
}
Cleaning Up Listeners
this entire site's content is contained in a single fla (no external loading)
on my "load page" method, i add all the listeners needed for that "page"
i have an "unload page" method that removes these listeners, because it may cause problems and conflicts with new mouse events of other pages...
these listeners carry a decent amount of weight.
is it beneficial to performance or memory management to remove ALL listeners that aren't needed? or does this not matter?
if there was no benefit, then i would be able to add some listeners on init, and never have to remove, re-add them. this would make code more manageable.
Cleaning Up Code
Worked on this for a while, does the jpb, but because of the way I have done it, I can't get any removeMovieClip() functions to work on the new instances . . .
Need it cleaned up an in a way that I can use a removeMovieClip on it and have it actually remove them all.
Very Tired an need a new pair of eyes on this.
ActionScript Code:
/*********** Row One ***********/function row_one() { X = 400; Y = 340; scale = 100; for (i; i<3; i++) { duplicateMovieClip(_root.easy, "row_one"+i, i); setProperty ("row_one"+i, _x, X); setProperty ("row_one"+i, _y, Y); setProperty ("row_one"+i, _xscale, scale); setProperty ("row_one"+i, _yscale, scale); i++; X += 165; } }/*********** Row Two ***********/function row_two() { X = 205; Y = 410; scale = 125; for (ii; ii<3; ii++) { duplicateMovieClip(_root.easy, "row_two"+i, i); setProperty ("row_two"+i, _x, X); setProperty ("row_two"+i, _y, Y); setProperty ("row_two"+i, _xscale, scale); setProperty ("row_two"+i, _yscale, scale); i++; X += 195; } }/************* Row Three *************/function row_three() { X = 175; Y = 500; scale = 150; for (iii; iii<3; iii++) { duplicateMovieClip(_root.easy, "row_three"+i, i); setProperty ("row_three"+i, _x, X); setProperty ("row_three"+i, _y, Y); setProperty ("row_three"+i, _xscale, scale); setProperty ("row_three"+i, _yscale, scale); i++; X += 225; } }row_one();row_two();row_three();
I have almost the same code in three different frames, just using different instabnces as the basis for the duplication, and another layer that has a timer, when timer runs out, takes you to the scoreboard, now all was working well before i changed it to duplicate function, I just pulled them in from the library, but they weren't all the same size an crap (for perspective) But now ehn I get to the scoreboard, the darn things are still running.
Need to kill em off somehow.
Thanx in advance.
Cleaning The Stage?
Hello, everyone. I need some help. I have a stage that's filled with dynamically generated isometric objects [ in the shape of a smiley, placed according to an array ], and when i click a button, i would like the stage to be cleared, then another frame with another isometric code and another array to load.
The problem i am facing now is that the items positionned from the smiley are still on the stage if the next array is smaller than the previous one. Do you guys/gals know of any way i could clear the stage before going on the next frame? Currenlty, i tried unloadMovieNum(depth) in between with this code:
Code:
n = 50;
onEnterFrame = function(){
trace(n);
n--;
unloadMovieNum(n);
if ( n<=0){
nextFrame();
} else { stop(); }
}
What happens is that it clears the stage, but doesnt load anything in teh following frame.
I hope that i was clear. If any confusion prevails, please answer the questions that linger in your minds.
Thank you in advance.
Cleaning Up The Actionscript?
Hello everyone,
I'm wondering if there is some type of command in flash, to be able to look thru the actionscript to find any code that refers to a movieclip that is no longer there.
Kind of like the auto indenting/error finder command in the AS window. But to just find actionscript that has no point (movie1._x = random()) - when "movie1" is no longer there
Please help
[AS] Help Cleaning My Code
Hey guys so i made a movieClip that is my button, on layer one, on layer 2 which is on top i made a blue box which is multiplied using flash 8 blend modes and its alpha is set to zero.
When you rollover it fades in using the tween and on rollout is fades out.
I wanted to keep in minimal moviclips so i added the same mc button 5 times to make a nav and i assigned button labels and i have each one use a different icon using the attachMovie.
The functions for rolover and rollout are set but what I need help in is cleaning up my code so its not so repetetive.
If u see below I am using the same stuff over and over. Please help.
Thanks In Advance,
Robert
ActionScript Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
//button Labels
this.company.btnLabel.text = "COMPANY OVERVIEW";
this.services.btnLabel.text = "SERVICES";
this.affiliates.btnLabel.text = "AFFILIATES & PARTNERS";
this.submit.btnLabel.text = "SUBMIT AN ACCOUNT";
this.contact.btnLabel.text = "CONTACT";
//button Icons
this.company.attachMovie("company_i", "company_mc", this.getNextHighestDepth(), {_x:20, _y:20});
this.services.attachMovie("services_i", "services_mc", this.getNextHighestDepth(), {_x:18, _y:20});
this.affiliates.attachMovie("affiliates_i", "affiliates_mc", this.getNextHighestDepth(), {_x:18, _y:20});
this.submit.attachMovie("submit_i", "submit_mc", this.getNextHighestDepth(), {_x:18, _y:20});
this.contact.attachMovie("contact_i", "contact_mc", this.getNextHighestDepth(), {_x:18, _y:20});
//
//buttons
this.company.onRollOver = function() {
roll(company.rollEffect);
};
this.company.onRollOut = function() {
roll_O(company.rollEffect);
};
this.services.onRollOver = function() {
roll(services.rollEffect);
};
this.services.onRollOut = function() {
roll_O(services.rollEffect);
};
this.affiliates.onRollOver = function() {
roll(affiliates.rollEffect);
};
this.affiliates.onRollOut = function() {
roll_O(affiliates.rollEffect);
};
this.submit.onRollOver = function() {
roll(submit.rollEffect);
};
this.submit.onRollOut = function() {
roll_O(submit.rollEffect);
};
this.contact.onRollOver = function() {
roll(contact.rollEffect);
};
this.contact.onRollOut = function() {
roll_O(contact.rollEffect);
};
//Button Effects
//RollOverFunction
function roll(btn_mc:MovieClip):Void {
new Tween(btn_mc, "_alpha", Strong.easeIn, 0, 100, 15, false);
}
//RollOutFunction
function roll_O(btn_mc:MovieClip):Void {
new Tween(btn_mc, "_alpha", Strong.easeIn, 100, 0, 30, false);
}
//
Overlapping Symbols Inside Symbols With An Alpha Tween
Hello,
In the attached example, Is it possible to prevent the purple overlap area from showing and just be red since red's on top? I have characters that use symbols for arms, legs, etc. and I want to fade them in and out sometimes. The problem is, the areas where the limbs overlap look weird so I have to resort to converting them to shapes on one keyframe. This seems limiting and annoying. I was wondering if there's a command, extension, or property to fix this. Thanks in advance.
Is It Not Possible To Assign Instance Names To Symbols Within Symbols In Flash CS3?
Detail question on nha khoa Adobe group
OK, so I have a player object. I created a symbol that is linked to the player. Inside the symbol I have 2 symbols. 1 is the sprite that displays the player, the other is a rectangle box that is used for collision detection.
I tried giving the collision box an instance name in the property editor so I could reference the collision box from code. The Player symbol is linked to a Player class I wrote earlier so it creates an instance of the Player class. The error I get is this:
ReferenceError: Error #1056: Cannot create property myCollBox on Player.
myCollBox was the instance name I gave that collision box symbol. I thought maybe I had to make the collision box also linked to a class to be exported for action script, but that didn't seem to help.
Cleaning Up Borders/edges
Been playing with some backgrounds and scenes trying to expand my animation library.
How do I clean up around the outer edges of my Flash art? For example, if my movie is 600x400, I'd like to have a nice rounded edge "movie" screen that is 595x395, and have all the "junk" that flowed over the edges to be deleted.
Sorry if this is a neophyte question, I'm not sure if I need to make a basic "background" bottom layer and delete around it, or what.
Thanks in advance.
tekchic
|