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




Is Loading Many Images In First Frame Efficient?



I am doing something like a company advertisement in flash (for web ofcourse) and i need to display a clip everytime a user clicks a particular button.
There are 8 or 9 such buttons.
I dont want the user to wait for the clip to load in runtime at each button click. Will loading all images in first frame work? How heavy will it be on the memory then?



KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 02-27-2007, 08:01 PM


View Complete Forum Thread with Replies

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

Processor More Efficient If Images Are Manipulated With Actionscript?
i'm working on a flash piece for a client which (inevitably) involves a lot of large bitmap images. knowing this may be problematic, i'm looking for the best way to optmize the piece, as well as ways to manipulate the images with the least burden on the processor. i'm wondering if things like fades, or movement of the images may be less processor-intensive if i use actionscript rather than tweening them, or if it just doesnt' matter. any other wisdom that may give me freedom to animate the images in an efficient manner, optimize, etc. would also be very helpful.
thank you!

On EnterFrame Or Frame Loop... What Is Most Speed Efficient?
Has anyone done any test on it? I'm working on a project where I've used onClipEvent(enterFrame) alot, but it's getting very heavy on the cpu... I'm wondering wether I should take the time to rewrite everything to use frame loops (frame 1; do something, frame2; gotoAndPlay(1)), or not....

--
@ndre

Trying For Efficient One-size-fits-all One-frame Scriptlet
hi. this works but looks like crap. whats wrong with it?


Code:

onClipEvent(load) {
mOver = false;
}
onClipEvent (enterFrame){
if (mOver) {
_yscale += (36 -_yscale)/4;
_xscale += (400 -_xscale)/4;
} else {
if (_xscale > 200) {
_yscale -= 20;
_xscale -= 20;
}
}
if (_xscale >= 400) {
mOver = false;
}
}
on (rollOver) {
mOver = true;
}
on (rollOut) {
mOver = false;
}

i have to make a bunch of button/links jump when mOvered - thought this'd be easier than cutnpasting frames - am i wrong there too?

Loading Frame Images For Movie, Most Effective Way?
Ok, basically i am just wandering what everyone thinks if the best way to load a movie.

I am learning OpenGL, and hopefully DirectX soon as well, and in some of my projects i am going to be displaying them on my website. I am going to be taking a frame by frame screen**** of my OpenGL movies to import them into flash, and i was wandering what everyone thinks is the best way to do it?

In my understanding i have two options,

1.) Take my Fla and load them all into it by hand.
2.) Make it more dynamic and loadthem at runtime via ActionScripts LoadMovie Command.


Now it would be easier on me to do #2, but i am not looking for ease. I am looking for the most effective in FPS at Runtime, Load Speed, and obviously tied into Load Speed, the File Size for people to load.

So which would be faster, better, smaller, ect.?
Thanks to any replies!

Dynamically Loading Multiple Images On One Frame
Hi,

If some one could help me with this I would be very grateful.
Is it possible to dynamically load more than one jpg into a frame at one time?
My actionscript only loads the last image.

Dynamically Loading Multiple Images On One Frame
Hi,

If some one could help me with this I would be very grateful.
Is it possible to dynamically load more than one jpg into a frame at one time?
My actionscript only loads the last image.

More Efficient Loading?
Im trying to set up a loading system that could be more effiicient. What im after:

1. the menu should load real fast. Then the user can browse it while the next levels are being loaded. (and by levels i mean levels of a game, like level 1..etc).

2. If the user was to start a new game, he would see a loading screen for level1.

3. while playing level 1, level 2 would be loading. And so on like that.

I think this could be real efficient if done right. I read in a similar post that this was not possible but i'd like a second (or few more) oopinions/suggestions.

HELP Need An Efficient Loading And Detection Actionscript
ARG! For some reason, my movie just doesn't want to work!
I keep trying to build a working loading AND flash 5 detection script, but they just don't like working together! I need help big time. If you know a working script for these, PLEASE let me know!
I need it to go in scene 1, then once the loading and detection are over, it should go to scene 2. Also, if the user doesn't have flash 5, I need my movie to go to and stop at a specific frame.
Thanks so much!

What's The Most Efficient Code For Loading A Movie?
I'm in the process of building this site:

www.tsunamiutah.com

and I used the preloader tutorial found here:

http://www.senocular.com/flash/tutorials/preloading/
(scroll down to Example 6)

and for some reason, the SWF's seem to run slower when loaded into the main movie. This can be most clearly seen if you click VIP link on my site and watch the animation. It runs REALLY slow. But, when you run the SWF by itself, as in here:

http://www.tsunamiutah.com/vip-test.html

it runs fine and at normal speed. I thought maybe the onEnterFrame was taking up the resources but the "delete onEnterFrame" command should've taken care of that right?

Any ideas?

What's The Most Efficient Code For Loading A Movie
I'm in the process of building this site:

www.tsunamiutah.com

and I used the preloader tutorial found here:

http://www.senocular.com/flash/tutorials/preloading/
(scroll down to Example 6)

and for some reason, the SWF's seem to run slower when loaded into the main movie. This can be most clearly seen if you click VIP link on my site and watch the animation. It runs REALLY slow. But, when you run the SWF by itself, as in here:

http://www.tsunamiutah.com/vip-test.html

it runs fine and at normal speed. I thought maybe the onEnterFrame was taking up the resources but the "delete onEnterFrame" command should've taken care of that right?

Any ideas?

Loading XML Vs Loading From Database? Which Is More Efficient?
Hi,

Once weekly I query my database to get the "Top Whatevers", and when they are determined I put them in a TopWhatevers table so that it can be queried easily via AMFPHP. I'm wondering if it would be more efficient to have the query write the results to an XML file which the swf could refer to rather than having to perform a database query every time. The AS3 E4X feature is slick but I'm not sure which is better for performance.

Also, I think I read somewhere that you could store the results within the swf itself and update them periodically when need be. Is that true?

Any thoughts?

Thanks!

Moving Images Frame-by-frame With Mouse Movement
Hi, I'm new to flash mx, so please help me out in details. thanks.
I have 10 images in 10 frames ( 1 image per frame ). So I'm trying to make the frame to go to the next one when the mouse is moved to the right, and make the frame to go to the prev one when the mouse is moved to the left.
Can someone please help me? I really need to have this done ASAP.
Thanks for all the inputs.

Moving Images Frame-by-frame With Mouse Movement
Hi, I'm new to flash mx, so please help me out in details. thanks.
I have 10 images in 10 frames ( 1 image per frame ). So I'm trying to make the frame to go to the next one when the mouse is moved to the right, and make the frame to go to the prev one when the mouse is moved to the left.
Can someone please help me? I really need to have this done ASAP.
Thanks for all the inputs.

Loading External Images Randomly, Getting The Amount Of Images Out A *.txt
hello there!


i've made an a script that loads images externaly from a specific map
randomly. there's only one thing:


how can flash learn to know how many images are loaded?


it's for a client so he can only upload the images and that's it.
can he somehow fill in a *.txt-file that flash can use further???


this is my sourcecode for the external-stuff:

code:

_root.importImage = "background_netomzet"+random(*)+".jpg";



(the * has to be a value that needs to be generated by how many pics
there are in the image map")


thanks a million people!


g

Loading Images Into A Container-H And V Images Centered
I am trying to load multiple images into a container clip to make an image gallery. Since there are both horizontal and vertical images I want the images to load into the center of the container clip (the center of container clip is aligned with the center of each image) because I cannot align both h and v images in my design by a corner. how do I do this?
Thank you!

Loading External Images Loading Bar (Movie Clip)
I have managed to have external images loaded with the progress bar. However, when I place these items into a movie clip the preloader no longer works. can someone please take a look at the flash file for me.

http://www.bloggot.co.uk/file.zip

Loading A Frame In _root And Also Loading An External Movie Problems.
First of all, hello everyone and nice to meet you

I have been hacking at a problem for a couple of days now and I am in need of help to solve it. Please excuse my noobishness, but I have a lot to learn when it comes to flash.

Here is my scenario:

I have my main movie (_root)
In the actions layer of my main movie I have:

Code:
this._lockroot = true;
I have a button that loads a new external movie at the end of which I want to load a particular frame in the main movie. I call this from the external movie:

Code:
on (release) {
_root.gotoAndPlay(610);
}
Everything up to here works brilliantly....But my problem arises when I also try to load an external movie onto level 5 at the same time as I am instructing the main movie to play frame 610 from an external movie. I want the external movie to call frame 610 in main, and also load a new external movie on level 5 in the main movie. I have tried about every way of loading movies that I can think of but I can never get the external movie to load along with frame 610 of the main movie. I even tried _root.loadMovieNum("myexternalmovie",5) right after my first root call, like this:

Code:
on (release) {
_root.gotoAndPlay(610);
_root.loadMovieNum("myexternalmovie",5)
}
Is that possible or do I have to approach this entirely differently? Thanks for any responses

Jagged Images When Not On Frame One
Has anyone else experienced the problem of images (graphpics) getting jagged if they are in anything other than a one frame (root) movie? I've had this problem over and over on different machines and different versions of Flash. I've tried everything to do a work around, put the entire site in a movie clip and put that on frame one of a one frame movie, load it in externally into a container clip, etc. it's just doesn't fix the problem...

Oh yeah, the problem doesn't have to do with the x, y, being integers. They are on exact integers on everytime line (parent on down). It has to do with the movie being longer than one frame on the root... I can post an example if that helps.

(Sorry to keep editing) It also is not that I'm resizing the images in Flash, they are being placed in at 100% and not resized. (just trying to save you time in responding!)

Images Into Frame With Buttons
I wanted to have 10 or so buttons and by clicking each button It would bring up
a different picture from the library (Or a folder on my pc) onto the movie.

But I would like this to be done with one frame (If Possible)
Sort of like a dress up game but adding the pics with buttons instead of dragging them around.

I have tried different codes but nothing works

Anyone know how I can do this ?
Thanks

How Do I Take Several BMP Images, Per Frame, And Lining Them Up?
Okay, I'm making an animation using Pivot Stickfigure beta 3 and I decided the best way I could do this is to save the animation as several different bmp images for quality look, this animation has well over 2500 frames and I'm not even close to done, I'm guessing that the animation when completed will run at least over 10 minutes. Anyhow I'm wondering how do I take those bmp (each has it's own frame) and align them up in the center?

Thank you.

newbyn00b

Images Continue In The Next Frame
This code goes right but the images (book, pencil...) appears again in the next frame. How can I solve this problem?
Help me!

//drag and drop code//


var startX:Number;
var startY:Number;
var counter:Number = 0;

var soundReq:URLRequest = new URLRequest("woodblock.mp3");
var woodblock:Sound = new Sound();
woodblock.load(soundReq);

pencil_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
pencil_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
schoolbag_mc.addEventListener(MouseEvent.MOUSE_DOW N, pickUp);
schoolbag_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
book_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
book_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
notebook_mc.addEventListener(MouseEvent.MOUSE_DOWN , pickUp);
notebook_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
student_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
student_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
teacher_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
teacher_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
friends_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
friends_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);

function pickUp(event:MouseEvent):void {
event.target.startDrag(false);
reply_txt.text = "";
event.target.parent.addChild(event.target);
startX = event.target.x;
startY = event.target.y;
}
function dropIt(event:MouseEvent):void {
event.target.stopDrag();
var myTargetName:String = "target" + event.target.name;
var myTargetisplayObject = getChildByName(myTargetName);
if (event.target.dropTarget != null && event.target.dropTarget.parent == myTarget){
reply_txt.text = "Good Job!";
event.target.removeEventListener(MouseEvent.MOUSE_ DOWN, pickUp);
event.target.removeEventListener(MouseEvent.MOUSE_ UP, dropIt);
event.target.buttonMode = false;
event.target.x = myTarget.x;
event.target.y = myTarget.y;
counter++;
woodblock.play();
} else {
reply_txt.text = "Try Again!";
event.target.x = startX;
event.target.y = startY;
}
if(counter == 7){
reply_txt.text = "Congrats, you're finished!";
}
}

pencil_mc.buttonMode = true;
schoolbag_mc.buttonMode = true;
book_mc.buttonMode = true;
notebook_mc.buttonMode = true;
student_mc.buttonMode = true;
teacher_mc.buttonMode = true;
friends_mc.buttonMode = true;

stop();

//next page code//

proximo_BT.addEventListener(MouseEvent.CLICK, release1);

function release1(evt:MouseEvent):void {
nextFrame();
}

Switching Images Within A Frame
Hi, total newbie and totally freaked out, did the search on google and did the search in online help, no use.

Seeking to switch images in a frame (without switching the frame of course). Like DynamicText allows to switch text.

Basically have numbered images which I want to call to the screen from an arrayed index, yes have a good idea of scripting and none of Flash.

Any pointers would be highly appreciated.

Scrollable Frame/Images
Hi, i have been registered on the forums for a while but havent made proper use of them. Sorry if this thread is in the wrong place.

My question is this, how do you create a frame-like object in Flash? In HTML its using the frame tags.

The reason for this is that i want to be able to have a scrollbar to show different images vertically.

Thanx

Dynamic Image Loading / Images Not Loading?
This is my first try at loading images with action script. I read through the forums, borrowed code, and adapted it.

///////////////////////////works fine
myvars = new LoadVars();
myvars.load("alldoorsdesc.txt");

myvars.onLoad = function (success) {
if (success) {
_root.doorsinsttxt.htmlText = myvars.d1txt+"<BR><BR>To order call us at 505 934 8888";
//I would like to create a for loop here so addidtional
//items can be added, is this possible?
_global.dr1txt = myvars.d1txt;
_global.dr2txt = myvars.d2txt;
_global.dr3txt = myvars.d3txt;
_global.dr4txt = myvars.d4txt;
_global.dr5txt = myvars.d5txt;
}
};
///////////////////////////doesn't trace to loaded door

var doormovie = _root.createEmptyMovieClip("imgmovie",_root);
doormovie._y = 100;
doormovie._x = 300;
doormovie._width = 300;
doormovie._height = 300;
function loadpic(num){
trace("inside loadpic" +num);
doormovie.createEmptyMovieClip("img"+num, num);
doormovie["img"+num].loadMovie("images/door"+num+".png");

//// I'm not sure about this line
doormovie["img"+num].onload = function(){trace("loaded door"+num);};

stop();
}

function unloadpic(num){cont["img"+num].removeMovieClip();}
function unloadAll(){cont.removeMovieClip();}
loadpic(1);// load the inital picture

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

Are all these functions loaded into the root visible from another movie that is imported with getURL ? Or do I have to copy the functions to that imported movie?

Loading Order - Dynamically Loading Images
Flash 5
I am trying to control the loading order of dynamically loading images. If I have 12 placeholders (4 columns by 3 rows) for the images (e.g. 12 instances of a movie clip) each of which loads a different JPG or SWF. I want the 1st instance/placeholder to completely load the image dynamically before the next instance starts to load the next image and so on. How can I ensure image1 is dynamically loaded before image2 and then image3 etc...

If I put each instance on a separate frame on the timeline will it stop on each frame until the instance is loaded before moving onto the next frame? I have seen the effect im trying to recreate on both:- www.rui-camilo.de and www.andyfoulds.co.uk

Many Thanks in advance.

Frame By Frame Loading Movie
I need to have a loading movie advance in relation to the frames it has loaded. I can get a "Bytes" preloader to work when I'm loading a movie, but when I have miltiple frames in the timeline it only wants to load the first frame then try to play and load as it goes. I used to
use "IfFrameLoaded" on the odd frames with a "GoTo" on the evens to advance the loading movie (Flash5). Anyways, sorry it's so long. If someone can help me it would be greatly appreciated.

Random Frame Stops Working When Images Are Used
Hello,
I have built a movie (Flash MX 2004 Porfessional) with the objective of going to a different frame each time the page loads. The movie works fine when I only have text in any of the frames. As soon as I add an image to any of the frames the ramdomization quits working. On top of that, the behavior is Opera/Netscape and IE is different.

In IE, the movie always displaysframe 1 (no content, just the actionscript).

In Opera/Netscape the movie always displays frame 2 (the first frame with content).

The code:

code:
var randomFrame; // Stores the randomly picked frame number
var numFrames; // Stores the total number of frames on the timeline
numFrames = _totalframes; // Assign _totalframes property to numFrames

// Pick a random frame
randomFrame = Math.floor(Math.random( ) * numFrames + 2);

gotoAndStop(randomFrame); // Send playhead to chosen random frame


I have attahed the file for convenience sake.
You can also see the behavior by going to the following two links:

with images (not working)
http://www.prophegy.com/temp/flash.html

w/o images (working):
http://www.prophegy.com/temp/flash2.html

Any insight into why this happens is greatly appreciated!!

John

Copying And Pasting Frame Images With Locations ?
Hi all,

Quick question ... When you copy and paste an image, symbol, etc is it possible to copy its x and y location values rather than having to type them in again each time ?

Thanks

Greg

Attaching Movies/images To A Specific Frame
Hi,

As far as I know, attaching movies/images, using attachMovie for internal elements, or loadMovie for external ones, always attaches it to the first frame.

So what if I want to attach something, let's say, to the second frame? Is it possible to do?

What I need to do is to dinamically build an animation on a movieclip with external images, so some images go to the 1st frame, and other go to other frames.

How can I do this with AS?

Best regards.

Movie Clip Images Deteriate If Not On Frame 1
Hi,

I'm having a real problem with a flash movie which I desperatly need to get sorted out ASAP.

I've a selection of logo's which simply need to fade in and out one at a time. This short looping animation is in a movieclip. Now if the movieclip is on frame 1 the logo's are in the quality they should be but if I place the movie clip on another frame with a stop(); command the logo's deteriate as if the .jpegs have been stretched slightly out of porportion.

I've tried everything I can think of such as having the logo movieclip in one file and then loading it into another level on a main movie and a later frame.

I really don't think I'm doing anything wrong as I use Flash everyday and generally know what I'm doing but I've never come across this problem before. If anyone has any idea's or know of any bugs in flash which may cause this please let me know.

Thank you, Craig

Trying To Display 2 Random Images In A Single Frame
Im trying to display 2 random images from a directory on my mainpage. I have the files listed in my xml file.... images.xml and using the following script pointing to my instance name picture_mc. all works well for 1 image..how can I get a second image and position it correctly? Do i have to clear the variables? is there an easy way to place the mulitple images into location? Script below...thank you for any help! Please keep explanations simple, I'm very very new at this:

this._x = 400; //Offset from top-left corner (0,0)
this._y = -100; //Offset from top-left corner (0,0)

xmlImages = new XML();
xmlImages.ignoreWhite = true;
xmlImages.onLoad = loadImages;
xmlImages.load("images.xml");

function loadImages(loaded) {
if (loaded) {
xmlFirstChild = this.firstChild;
imageFileName = [];
totalImages = xmlFirstChild.childNodes[0].childNodes.length;
for (i=0; i<totalImages; i++) {
imageFileName[i] = xmlFirstChild.childNodes[0].childNodes[i].attributes.title;
}
randomImage();
}
}
function randomImage() {
if (loaded == filesize) {
var ran = Math.round(Math.random() * (totalImages - 1));
picture_mc.loadMovie(imageFileName[ran],1);
pause();
}
}

Help With Efficient AS And XML
I have some code which currently works fine for getting the XML data in there, but I want to be able to duplicate my movie clips (resourceSlot_mc & dateSlot_mc) and load additional XMl data, if it is there.

How do I make this code more efficient for this task as well as for duplicating the movie clips?

Here is the code:


Code:
databaseXML = new XML();
databaseXML.ignoreWhite = true;

databaseXML.onLoad = function (success) {
if (success) {

// Populate the dateField with: <date month="Jan." day="14th" year="2004"> from the XML file.
dateSlot_mc.dateField.text += this.firstChild.firstChild.attributes.month +this.firstChild.firstChild.attributes.day +this.firstChild.firstChild.attributes.year;;

// Populate the resourceField with:
// <resource resourceName="John Smith"> from the XML file.
resourceSlot_mc.resourceField.text += this.firstChild.firstChild.firstChild.attributes.resourceName;

// Populate the projectIdField, clientField, projectField & timeField with:
// <project clientName="Client 1" projectID="Project001" projectName="Brochure"
// projectTime="8:00am - 12:00pm"/>
resourceSlot_mc.projectIdField.text += this.firstChild.firstChild.firstChild.firstChild.attributes.projectID;
resourceSlot_mc.clientField.text += this.firstChild.firstChild.firstChild.firstChild.attributes.clientName;
resourceSlot_mc.projectField.text += this.firstChild.firstChild.firstChild.firstChild.attributes.projectName;
resourceSlot_mc.timeField.text += this.firstChild.firstChild.firstChild.firstChild.attributes.projectTime;
} else {
dateField.text += "Loading Error!";
}
}
databaseXML.load("resource.xml");

More Efficient Way?
Hey, I have this function but its abit on the long side, and I want to add some more variables to it, so it will be even longer. Is there a more efficient way of writing this? Thanks for any help, Harro.

code: sendLatest = new LoadVars();
getLatest = new LoadVars();
sendLatest.sendAndLoad("php/latest.php", getLatest, "POST");
getLatest.onLoad = function() {
_global.latestone = getLatest.latest1;
_global.latesttwo = getLatest.latest2;
_global.latestthree = getLatest.latest3;
_global.latestfour = getLatest.latest4;
_global.latestfive = getLatest.latest5;
_global.latestsix = getLatest.latest6;
_global.latestseven = getLatest.latest7;
_global.latesteight = getLatest.latest8;
_global.latestnine = getLatest.latest9;
_global.latestten = getLatest.latest10;

_global.latestidone = getLatest.latestid1;
_global.latestidtwo = getLatest.latestid2;
_global.latestidthree = getLatest.latestid3;
_global.latestidfour = getLatest.latestid4;
_global.latestidfive = getLatest.latestid5;
_global.latestidsix = getLatest.latestid6;
_global.latestidseven = getLatest.latestid7;
_global.latestideight = getLatest.latestid8;
_global.latestidnine = getLatest.latestid9;
_global.latestidten = getLatest.latestid10;
gotoAndStop(2);

};

[CS3] What Is Better/more Efficient Would You Say?
Just asking opinions here, what does everyone think is better for OOP and what is more effecient to do?

To have each class control itself with an onEnterFrame event inside the class? e.g.

Code:
class A extends MovieClip
{
public function A()
{
this.onEnterFrame = whatever;
}
}

class B extends MovieClip
{
public function B()
{
this.onEnterFrame = whatever;
}
}
Or to have a main class, instantiate the subclasses, and then run update methods in those instances through a for loop in the main class? e.g.


Code:
class A extends MovieClip
{
public function A()
{
}

public function update()
{
//do stuff
}
}

class B extends MovieClip
{
public function B()
{
}

public function update()
{
//do stuff
}
}

class Main extends MovieClip()
{
public function Main()
{
//instantiate instances of A and B, and add them to some arrays for looping through
this.onEnterFrame = this.enterFrameHandler;
}

private function enterFrameHandler()
{
//loop through arrays of instances and run update() in them
}
}

[F8]/[CS3]Which Is More Efficient?
I'm working on a website with a flash header (pretty big one) and the content in PHP (html). I have a section about in the middle (flash as well, but half the width of the above header) of the page which displays the current promotions (featured products).

I can include this part either as a piece of the upper header and use wmode opaque and show on top with z-index (on the left and right side) the html menus OR have them as 2 separate, independent swf files (and i'm not reffering here to a loadMovie in the bigger, upper header, just another embed).

My question is which solution is better, especially if taking into consideration resource consumption especially but also bandwidth, time to load and eventual problems which could arrise?

Is This Efficient?
Im making a space arcade shooter. Generaly i have my enemy ships, but instead of making a bunch im just duplicating them. So every time they duplicate they add themselves to an Array called books (don't ask, i went too far to change it to anything else... heh).

The lasers that the player ship shoots has a constantly running for loop that runs through the Array to see if the laser is colliding with any object in the array (any of the enemies).

HOWEVER! im shooting only one laser in a stream right now. Later on i want to include powerups to add diff types of lasers and more#'s of them and the such.

Question is: If i have so many shooting later, that will be a lot of for loops right? so won't that slow everythign down? I want to know before i go too far.

Efficient?
onClipEvent(enterFrame) {
//y for horizontal walls
if(_root.wall1.hitTest(_root.player)){
setProperty(_root.player, _y, vLastY);
} else if(_root.wall2.hitTest(_root.player)) {
setProperty(_root.player, _y, vLastY);
} else if(_root.wall3.hitTest(_root.player)) {
setProperty(_root.player, _y, vLastY);
} else if(_root.wall4.hitTest(_root.player)) {
setProperty(_root.player, _y, vLastY);
} else if(_root.wall5.hitTest(_root.player)) {
setProperty(_root.player, _y, vLastY);
} else if(_root.gate1.hitTest(_root.player)) {
setProperty(_root.player, _y, vLastY);
} else if(_root.gate2.hitTest(_root.player)) {
setProperty(_root.player, _y, vLastY);
} else if(_root.gate3.hitTest(_root.player)) {
setProperty(_root.player, _y, vLastY);
} else if(_root.key1.hitTest(_root.player)) {
_root.gate1.gotoAndPlay(2);
_root.key1.gotoAndPlay(2);
} else if(_root.key2.hitTest(_root.player)) {
_root.gate2.gotoAndPlay(2);
_root.key2.gotoAndPlay(2);
} else if(_root.key3.hitTest(_root.player)) {
_root.gate3.gotoAndPlay(2);
_root.key3.gotoAndPlay(2);
} else if(_root.endlevel.hitTest(_root.player)) {
_root.gotoAndPlay(2);
}

// x for vert walls
if(_root.wallA.hitTest(_root.player)) {
setProperty(_root.player, _x, vLastX);
} else if(_root.wallB.hitTest(_root.player)) {
setProperty(_root.player, _x, vLastX);
} else if(_root.wallC.hitTest(_root.player)) {
setProperty(_root.player, _x, vLastX);
} else if(_root.wallD.hitTest(_root.player)) {
setProperty(_root.player, _x, vLastX);
}



if(Key.isDown(38)) {
//38 is down arrow
vlastY = getProperty(_root.player, _y);
vLocationY = getProperty(_root.player, _y);
setProperty (_root.player, _y, vLocationY -10);
}
if(key.isDown(40)) {
//40 is up arrow)
vlastY = getProperty(_root.player, _y);
vLocationY = getProperty(_root.player, _y)
setProperty (_root.player, _y, vLocationY +10);
}
if(key.isDown(37)) {
//37 is left arrow
vLastX = getProperty(_root.player, _x);
vLocationX = getProperty(_root.player, _x)
setProperty (_root.player, _x, vLocationX -10);
}

if(key.isDown(39)) {
//39 is right arrow
vLastX = getProperty(_root.player, _x);
vLocationX = getProperty(_root.player, _x)
setProperty (_root.player, _x, vLocationX +10);
}
}


that is the code i am using for this maze type game i am trying to make, and everything works great, but what i'm wondering is, if thats how you have to do it? so if i have 60 maze walls, i'm going to have to write 1 if statement and 59 else statements?

Which Is More Efficient?
Which is the most efficient method of loading data in: LoadVars, or LoadVariables?

I need to do a data driven (ASP + Access) Flash site, and was wondering which is the most efficient to use (mainly in terms of speed for visitors).

Thanks in advance

Is There A More Efficient Way?
Guys i need help with the following effect,

let's say i have 4 circular icons...on rollover i'd like to zoom in on them, well one at a time, and at the same time i want the other icons to be pushed out of the way (so they're all visible no matter how big the zoomed in overstate is (or how far apart they are from each other for that matter).

RageW0lf helped me a little bit... basically keeping every one of them at a distance (ActionScript:

if (mysymbol._xscale>100) {
this._x = mysymbol._xscale - 100 + 15;
}

With 5 or so buttons this can get really bulky i mean each of the buttons needs to know if the rolledOver button is on the left or right in order to slide to the right (+x) or left (-x)

Do you guys know a more efficient object oriented way of doing this. Help if you do or have any idea how to go about it ,

Thanks in advance,
Artom

More Efficient
I plan on making a portfolio of images for my site. I want to have a small thumbnail and a larger version of th image. When you roll over the thumbnail the large one pops up.
I know how to do this but I want to keep my file size to a minimum. So for those technically inclined out there here are a few questions.
Will loading Jpegs from external files be "much" slower than haveing a full sized jpeg in my library?
If I Keep my jpegs in my movie library is it more efficient to have the thumbnails made up from the orginal image (just shrink them down) or should I load in separate jpeg thumbnails.

Thanks guys

Most Efficient Way To Use A Bmp As A Bg
hi,

i am looking for some advice please. i want to make a flash site that will have 3 or 4 sfw files. each swf has the same background image that takes up all the movie.

it doesn't seem right to load it each time i load a new swf on a different level but i can't see how you set the bg to be transparent. ideally i think i should have a swf with the bg image on it and then that loads the content swf on top. then i could load and unload swfs.

what am i missing??

cheers

Efficient?
onClipEvent(enterFrame) {
//y for horizontal walls
if(_root.wall1.hitTest(_root.player)){
setProperty(_root.player, _y, vLastY);
} else if(_root.wall2.hitTest(_root.player)) {
setProperty(_root.player, _y, vLastY);
} else if(_root.wall3.hitTest(_root.player)) {
setProperty(_root.player, _y, vLastY);
} else if(_root.wall4.hitTest(_root.player)) {
setProperty(_root.player, _y, vLastY);
} else if(_root.wall5.hitTest(_root.player)) {
setProperty(_root.player, _y, vLastY);
} else if(_root.gate1.hitTest(_root.player)) {
setProperty(_root.player, _y, vLastY);
} else if(_root.gate2.hitTest(_root.player)) {
setProperty(_root.player, _y, vLastY);
} else if(_root.gate3.hitTest(_root.player)) {
setProperty(_root.player, _y, vLastY);
} else if(_root.key1.hitTest(_root.player)) {
_root.gate1.gotoAndPlay(2);
_root.key1.gotoAndPlay(2);
} else if(_root.key2.hitTest(_root.player)) {
_root.gate2.gotoAndPlay(2);
_root.key2.gotoAndPlay(2);
} else if(_root.key3.hitTest(_root.player)) {
_root.gate3.gotoAndPlay(2);
_root.key3.gotoAndPlay(2);
} else if(_root.endlevel.hitTest(_root.player)) {
_root.gotoAndPlay(2);
}

// x for vert walls
if(_root.wallA.hitTest(_root.player)) {
setProperty(_root.player, _x, vLastX);
} else if(_root.wallB.hitTest(_root.player)) {
setProperty(_root.player, _x, vLastX);
} else if(_root.wallC.hitTest(_root.player)) {
setProperty(_root.player, _x, vLastX);
} else if(_root.wallD.hitTest(_root.player)) {
setProperty(_root.player, _x, vLastX);
}



if(Key.isDown(38)) {
//38 is down arrow
vlastY = getProperty(_root.player, _y);
vLocationY = getProperty(_root.player, _y);
setProperty (_root.player, _y, vLocationY -10);
}
if(key.isDown(40)) {
//40 is up arrow)
vlastY = getProperty(_root.player, _y);
vLocationY = getProperty(_root.player, _y)
setProperty (_root.player, _y, vLocationY +10);
}
if(key.isDown(37)) {
//37 is left arrow
vLastX = getProperty(_root.player, _x);
vLocationX = getProperty(_root.player, _x)
setProperty (_root.player, _x, vLocationX -10);
}

if(key.isDown(39)) {
//39 is right arrow
vLastX = getProperty(_root.player, _x);
vLocationX = getProperty(_root.player, _x)
setProperty (_root.player, _x, vLocationX +10);
}
}


that is the code i am using for this maze type game i am trying to make, and everything works great, but what i'm wondering is, if thats how you have to do it? so if i have 60 maze walls, i'm going to have to write 1 if statement and 59 else statements?

Is There A More Efficient Way?
Guys i need help with the following effect,

let's say i have 4 circular icons...on rollover i'd like to zoom in on them, well one at a time, and at the same time i want the other icons to be pushed out of the way (so they're all visible no matter how big the zoomed in overstate is (or how far apart they are from each other for that matter).

RageW0lf helped me a little bit... basically keeping every one of them at a distance (ActionScript:

if (mysymbol._xscale>100) {
this._x = mysymbol._xscale - 100 + 15;
}

With 5 or so buttons this can get really bulky i mean each of the buttons needs to know if the rolledOver button is on the left or right in order to slide to the right (+x) or left (-x)

Do you guys know a more efficient object oriented way of doing this. Help if you do or have any idea how to go about it ,

Thanks in advance,
Artom

Is There A More Efficient Way Than This...?
I have a movie with three navigation tabs. These tabs all have the same behaviours. The code I have written works perfectly well, but it just isn't very elegant. There must be a better way than the way I have done it.

Can anyone help me by showing me a more efficient way to code this? :-
CODE//-----------define all button actions-----------------

tab01.onRollOver = function() {
    moveTab(tab01, moveSpeed);
};
tab01.onRollOut = function() {
    returnTab(tab01, moveSpeed);
};
tab01.onPress = function() {
    colourTab01.setTint(255, 0, 0, clickShade);
};
tab01.onRelease = function() {
    colourTab01.setTint(0, 0, 0, 0);
    gotoAndStop("tab01");    
    interaction(1);    
};


tab02.onRollOver = function() {
    moveTab(tab02, moveSpeed);
};
tab02.onRollOut = function() {
    returnTab(tab02, moveSpeed);
};
tab02.onPress = function() {
    colourTab02.setTint(255, 0, 0, clickShade);
};
tab02.onRelease = function() {
    colourTab02.setTint(0, 0, 0, 0);
    gotoAndStop("tab02");
    interaction(2);
};

tab03.onRollOver = function() {
    moveTab(tab03, moveSpeed);
};
tab03.onRollOut = function() {
    returnTab(tab03, moveSpeed);
};
tab03.onPress = function() {
    colourTab03.setTint(255, 0, 0, clickShade);
};
tab03.onRelease = function() {
    colourTab03.setTint(0, 0, 0, 0);
    gotoAndStop("tab03");
    interaction(3);
};

//-----------------end button actions---------------------

More Efficient Way?
There has got to be a more effecient way of writing this:


ActionScript Code:
chart_btn._alpha = 0;
slider_btn._alpha = 0;
crosstab_btn._alpha = 0;
chart_btn.onRollOver = function() {
    this._alpha=100;
}
chart_btn.onRollOut = function() {
    this._alpha=0;
}
slider_btn.onRollOver = function() {
    this._alpha=100;
}
slider_btn.onRollOut = function() {
    this._alpha=0;
}
crosstab_btn.onRollOver = function() {
    this._alpha=100;
}
crosstab_btn.onRollOut = function() {
    this._alpha=0;
}


Sandman9

Which Is More Efficient?
I have an XML onLoad event that reads loads data into a data object. Is there any difference in efficiency between having the XML handler set the property directly or calling a method on the object that sets the property?

Which Syntax Is More Efficient?
Someone has told me that the slash syntax is much more efficient than dot syntax? And just the same that tellTarget runs faster than with.
Is it true?

How Can I Make This More Efficient?
Help! Check this out: http://simonabrams.com/drawing/paint_test.swf

I'm having a couple of problems with this movie. I need to do two things:

1) Add a "crayon" as a cursor, and make the circle that is the "brush" invisible

2) I need to make this so it doesn't slow down to a crawl after playing with it for a while.

Basically, I need to make it look like the user is picking up a crayon, and gets to color in the image (one crayon magically colors in all the colors of the image).

Any ideas? By the way, this thing is based on the "Draggable Magnifying Glass by The Freehand Site (available as an extension from Macromedia), and the "simple airbrush" I found somewhere within these boards. The .fla file is in http://simonabrams.com/drawing/

Thanks, guys.

- Simon
[Edited by flysi on 02-05-2002 at 07:46 PM]

A More Efficient Animation
I have several pict files and type in a movie I'm making. Will the movie player file run better if I break apart the picts and the text before exporting it or doesn't it matter. I seem to notice some speed issues and I'll break them apart if it will help.

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