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




Detecting .swf File Size.



I was wondering if there is a way of setting some dynamic text, so that it would show the accurate size of the aniamtion? in kilabytes?Mark



KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 07-10-2005, 10:14 PM


View Complete Forum Thread with Replies

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

Detecting File Size?
Hey everyone, Just starting out in flash here and I really need to know how one can check if a certain file has been updated.

I'm using flash mx and my file reads data from an xml file so I need to know say like every minute if the file has been updated. Knowing if the size of the file has changed should be sufficient, Thanx :P

Obscure Question About Detecting File Size
So I did a search for this, and didn't come back with much - so I figured I'd throw it out there...

Does anyone know of a way to detect the size of a file outside of flash? -

IE..

I have flash hitting an XML file at 15 second intervals, however, sometimes flash hits the file when it is incomplete(being updated, and uploaded) and flash loses all the values that it has until it loops back and the file is complete. So.. is there a way for me to hit the XML file once, and store the file size (like, 40k) and then on the next loop have it check to make sure the filesize is >=40k before it hits it again?

I know, fairly obscure, but much easier than trying to make flash hold all the vars if they come back as undefined, i would think?

Thanks!

Scene File Size Huge Compared To Seperate Movie File Size?
I have a flash movie with multiple swf files imported into different movieclips throughout. Each of the imported movieclips is a seperate scene of the original movie. The thing I found out is that if I copy all the frames of scene 2 for example, and paste them into a new movie. Then publish the new movie as a swf. The file size is much smaller than the scene 2 swf when published from the original movie. Does anyone know why?

Detecting Both Clips Size >>> Please Help
Ok.. I have 2 squares...

I want when you roll over one clip the other one will keep the same distance from the other and vise versa. Here is the code I have now.
What it's dong now is just moving both of them side to side when one of them grows bigger. I would like them to stay in one spot and just move the other when one resizes.

Thanks for your help in advance

Here is the code I have in both clips. Each pointing at the other on the bottom. Names are clip1 and clip2

onClipEvent (load)
{
var friction = .05

var startxscale = _width
var targetxscale = startxscale

var startyscale = _height
var targetyscale = startyscale
}

onClipEvent (enterFrame)
{
_width += (targetxscale - _width) * friction
_height += (targetyscale - _height) * friction
}
onClipEvent (enterFrame){
this._x = _parent.clip2._x - (_parent.clip2._width/2 + 55);
}


They are 90 px squares.

[MX] Detecting Screen Size
Ok, I've looked around and I've seen a lot about setting the size of the browser window etc., but nothing that does what I want to do. Also, just so you know I'm not lazy, I do have a potenial solution for this using javascript, but it's using functions and setVariable and it throws up security errors. Basically, I want the swf to find the size of window it's in, using MX. The reason is I'm making a menu that has stuff that floats around, and I want to know the boundries, no matter what resolution I'm in. Any help would be nice.

Detecting LoadMovie Size
hey all

Is is possible to detect the size of the JPG using "loadMovie" so that the mc that the JPG is loading into can automatically resize to fit it?

Detecting Screen Size
what was the script to detech screen size?

let's say i want a logo to always appear on the left bottom side of the internet explorer:

logo_mc._y = ?screensize?._y - 10
logo_mc._x = ?screensize?._x + 20

something like that?

Detecting If Browser Changes Size?
Is there a way to read the current size of the browser window in which a flash movie is embedded?

Detecting Browser Window Size...?
is there a way to detect the browser window size and then changing the size of your flash accordingly?
instead of not knowing the size of final output and end up looking stupid with a 640x480 window when the guy has a 1600xwhatever resolution full screen browser window... or having a 1024x768 flash that you have to scroll around on a 800x600 resolution browser...

help?

Detecting Stage Size After Fscommand....
I'm using fscommand to do a fullscreen open of a flash movie....one problem though....I need to get the stage dimensions(width and height) when flash opens up as fullscreen.....does anyone know how to do this.....'cause I'm beating the crap outta myself here trying to find out.....

Detecting Font Size In HTML Browser.
Hi all,

I am interested in accessibility in Flash MX 2004. I would like to be able to get my Flash text (using system font) to resize according to the settings of the browser window, and to scroll accordingly.
I this possible or am I asking too much, as the accessibility rules already are!?

Thanks

Detecting Stage Size Of Loaded Movie
I've searched everywhere for an answer to this, without luck.

Is there ANY way of detecting the size of the stage of an swf that I have loaded into an fla using loadmovie?

I am trying to create a "master" movie that will dynamically load a series of swfs based on the contents of a text file and then - irresepective of their original dimensions - show them at an identical size. It all works swimmingly until I come across a movie that extends beyond the bounds of its stage.

Any thoughts vastly apprceiated.

Detecting Browsers Font Size Setting
I'm wondering if it is possible to somehow detect a users font size setting that the browser has? Does anyone knows or can anyone point me in the right direction? I would like to change the text size in my movie acording to the size the user normaly views HTML text at and if the setting is changed in the browser, have flash detect this and change it's text also. Thanks.

Urban

Detecting Screen Size / Launching According Popup Windows
this should be an easy one...not for me though

- the main page has an entry button, and when the mouse rolls over it you get two options: 1000x500 or 600x400. you then choose which size best suits your screen resolution.

- i would like to have at the bottom "your screen resolution is x by x"

- then when the window pops up, obviously centered, i want it to have a name and no scrollbars or resizing or absolutely anything.

i now it's a lot to ask, but any help would be GREATLY appreciated...THANKS

Detecting Internet Explorer Window Size Dynamically
Hey, i was wondering if you had a "non-popped"-window , with some javascript in the HTML, would you be able to make call from flash that would keep you uptodate with that size the internet explorer window is..

thnx

Detecting Screen Size - Not Working In My Mobile Device
Hello Guys,

Actually I got the below code from net to detect the portrait and landscape screen. When I checked the same in mobile device it didn't work properly. I am using O2 Autom device.

Can you please let me know why is it so....!!! or Do I need to add anything more..?

Code:

stop();

fscommand2("FullScreen", true);

/* Set scaleMode to "noScale" setting: the SWF will not be scaled
when the size of the screen device changes*/
Stage.scaleMode = "noScale";

//Set the current alignment of the Flash movie to "Top Left"
Stage.align = "TL";

// Create a new movie Clip
this.createEmptyMovieClip("container",this.getNext HighestDepth());
container._x = 0;
container._y = 0;

//Detect the screen size and load the correct file
if (Stage.width == 240) {
container.loadMovie("myApp_portrait.swf");
} else {
container.loadMovie("myApp_landscape.swf");
}

Flash Player Doesn't Detecting The Original Size Of The Movie At Run Time
I've a movie that using flash UI Component scrollbar with a dynamic text area. I've rendered the text by including an external .as file. The content for the scroll bar is written in the .as file and that .as file included #include "myfile.as"

The problem is that I can't make a correct preloader for the movie. Because the flash player detects the size of the movie before the text is being rendered. The text is being rendered only in the run time from the external .as file. So again I've to wait a bit more time to load the content after loading the swf file.

I've converted the file to exe. But the problem still exists.

Anybody to help

abhilash

Flash Player Doesn't Detecting The Original Size Of The Movie At Run Time
I've a movie that using flash UI Component scrollbar with a dynamic text area. I've rendered the text by including an external .as file. The content for the scroll bar is written in the .as file and that .as file included #include "myfile.as"

The problem is that I can't make a correct preloader for the movie. Because the flash player detects the size of the movie before the text is being rendered. The text is being rendered only in the run time from the external .as file. So again I've to wait a bit more time to load the content after loading the swf file.

I've converted the file to exe. But the problem still exists.

Anybody to help

abhilash

Why Use Flash Video When It Bumps The File Size To Outrageous Size?
I have imported a flash video into my flash movie. I have run the .mov in sorenson squeeze and have it nice and small. As soon as I import it into flash (because this is the only way I know to do it in order to run a video in flash) now I have 1024 frames and a HUGE .swf file.

So what is the point to using flash at all...or am I doing something wrong. Is there a better way to handle video within flash??

Thanks
Fitchic77

Making Canvas Size And File Size Smaller
Hi guys,
I made a flash projector file recently for my company,
Its 1024 * 768, and a pretty big file size, but we had it burned onto dvd so that was ok....

However now I want to make it 250 * 250, cut the filesize down, and put it on the companies web site....

Is there any way i can do this in flash?
can I do it in Premiere/ After effects...
Any other places

Thanks
Stefan

Preloader Size Doesn't Match File Size.....
Alrighty, my preloader says that my filesize is 242kb. MY ACTUAL filesize is 179kb, according to flash and windows. Is there something I am missing here?
Why is my preloader giving me garbage?

www.paulhanak.com is the site.

Here is the code:

Code:
totalBytes = Math.round(getBytesTotal() / 1024);
loadedBytes = Math.round(getBytesLoaded() / 1024);
percentDone = Math.round((loadedBytes / totalBytes) * 100);
if (_root._framesloaded >= _root._totalframes) {
gotoAndPlay("start");
}
Thanks for any help! This is mind boggling.....

Detecting The Url Of A SWF (so I Know If Its Playing As A File Or In A Bowser)
i used to use a simple technique to detect weather the swf was playing in a bowser or as a file in the flash authoring environment. i did it so that i could have different file paths for eternally loaded content depending on weather i was looking at it in a bowser or as if i had just ctrl + retuned in flash

AS2 code:

Code:
phpPath = (_url.charAt(0) == "f") ? "http://localhost:8888/blunt_new/inc/" : "inc/";
if the swf was running in the authoring environment or you had just double clicked a swf in the operating system the first part of _url would be "file....." rather than "http://....."

so my question is how do i get at the the swf's URL in AS3? or is there a better way of detecting whether its running in the browser or as a stand alone SWF?

[MX] Detecting Changes To External Data File With AS 1.0
I am using CS3, but changing an old application written in AS 1.0 - flash player 6.

I am making changes to an application that displays data on the screen, updating from changes to the xml file it is reading from.

Currently, the application is using the 'getBytesTotal' function to check for changes to this file once every second. This works great until I have a change that keeps the same byte size - eg: <node>2</node> vs. <node>5</node>. Which is what is happening...

I searched for a way to return the date modified time stamp, and couldn't find anything for AS 1.0. I then thought I could try to write an actionscript checksum function, but didn't know how to implement this with AS 1.0's seemingly limited built in functionality and objects.

I spoke with the server side folks about having a php or javascript function to do a checksum on the file on their side that I could just call, and they aren't sure if the hardware can handle it. (I mentioned this was an old app, it's also running on old HW).

To sum it all up - what I am looking for is a solution to detect changes to an external xml file in Actionscript 1.0, that can detect small changes that wouldn't affect bytes ize and doesn't require server side functionality.

I'm really open to suggestion here...

Much thanks!

Detecting If The Mouse Is Inside Swf File
I have a series of swf files on one page. I want them to play when the user hovers the mouse over the embeded swf file, and stop when the they are not. Example, here is the layout:

._______.
|...........|
|..File 1..|
|_______|
._______.
|...........|
|..File 2..|
|_______|
._______.
|...........|
|..File 3..|
|_______|

So i want to know if the mouse is over file 1, file 2, or file 3. I've tried the following:

if(_root._xmouse > 0 && _root._xmouse < Stage.width && _root._ymouse > 0 && _root._ymouse < Stage.height) {
inside();
} else {
outside();
}
the inside() works, but the outside() doesn't because flash will stop providing the x position and y position of the mouse when it is outside the swf file.

So I was wondering if there was a better way to do this?

Detecting Line Returns In Txt File
Is there a way to have flash detect hard returns in text files as the variable are read in from loadVariables()

Detecting The Html File That Flash Is Embedded In
I would like to have the flash movie know what html file it is embedded in...automatically. I will be resuing a flash movie across a web site, and you like the contents of the flash movie to be slightly different depending on the page.

If I could detect the html page's name or the url that would do the trick. Is this possible?

Thanks,
Dege

Detecting Existing File On Users Computer
I am developing an interface for a CD and need to determine if a specific file exists in a specific location on the users computer. Does anyone know if Flash MX is capable of doing this? If so how? If not, what do you suggest. Thanks.

MovieClipLoader: Detecting File Type Or Extension?
hi,
I'm trying to use the movieClipLoader class to load different mc's, sometimes SWF's, sometimes JPGS, and depending on whats being loaded, have different actions occur on load completion. Is there anything built in to movieClipLoader that captures that info? If not, can anyone recommend a good way to handle that? I thought of passing a parameter to movieClipLoader but I'm not sure how to do that...

Thanks!

.z

Detecting The End Of An External Swf File In An Empty Mc Or Loader
Hi!
Im currently trying to upload an external swf file trough an empty mc.
But since in this case i will be changing the swf file at times, i hope i could have an actionscript that detects the end of the external swf file and then gets the command gotoAndPlay(2).

thanks for reading

hope someone know how

Detecting A Change Event In An Include File
I am new to actionscript and I am trying to detect a change event in a class . I am using the demo files located on http://www.adobe.com/support/documentation/en/flash/fl8/samples.html#component_samples
This is the CheckBox and ComboBox cell renderer class examples. Since the combo box change event fires is in the class.
How do I detect the change in the datagrid in the root form? I have tried the datagrid change event but because the combo boxes are created dynamically in the class the datagrid change event doesn't see the change.
Thanks

If/Else, Detecting File Type, Switching Frames
Hey guys, I am an actionscript novice, and I am trying to wade through an experts code. There is a problem with the website that I am trying to finish up, and I thought I would give it a go on my own.... however I can't seem to get it right.

Here is the situation:
I have a website that displays a thumbnail image. The thumbnail can link to a large png, animated swf, or link to nothing.

Under the thumbnail, I have a little icon. "Click to Enlarge" or "Click to Play".

The Icon is a single movie clip, with the different words on different frames.

Enlarge_mc:
Frame 1 = Click To Enlarge
Frame 2 = Click To Play

So, what I want to do is add two more states to the Enlarge_mc.
Frame 1 = Click To Enlarge
Frame 2 = Click To Play
Frame 3 = Click Links Below
Frame 4 = <display nothing>

Currently, I have an external .as file with the following code:

Code:

public function load ( url : String, locNum : Number, inAutoPlay : Boolean, inHideControls : Boolean ) : Void {

if ( inHideControls ) hideControls();

//trace( 'load media: ' + url + ' into loc num : ' + locNum + 'from : ' + mc );

for ( var i = 0; i < 50; i++ ) {
loc[ 'image_' + i ].stopTween();
loc[ 'image_' + i ].alphaTo( 0, .25, ani );
}

var loadCr : MovieClip = loc[ 'image_' + locNum ];
var loadTo : MovieClip = ( loadCr != undefined ) ? loadCr : loc.createEmptyMovieClip( 'image_' + locNum, locNum );

if ( url.indexOf( '.swf' ) > -1 ) {

player._visible = true;
player.loadFile( url, true )
dispatchEvent( { type : 'toggleEnlargeButton', target : this, frame : 2, enabled : true } );

} else if ( url.length == 0 ) {

dispatchEvent( { type : 'toggleEnlargeButton', target : this, frame : 3, enabled : false } );

} else if ( url.toLowerCase() == 'no_file' ) {

dispatchEvent( { type : 'toggleEnlargeButton', target : this, frame : 4, enabled : false } );

} else {

dispatchEvent( { type : 'toggleEnlargeButton', target : this, frame : 1, enabled : true } );
player._visible = false;
if ( loadCr == undefined ) {
mcl.loadClip( url, loadTo );
} else {
loadTo.alphaTo( 100, .25, ani, .25 );
}
}
}
Is there any reason why this wouldn't work? Because it still switches between frames 1 and 2, but refuses to go to frame 3 or 4.

Oh, one more thing.

The movie gets the file information from an xml file with the following code:

Code:
<images>
<image file = "my_thumbnail_01.png" enlarged = "large_01.png" />
<image file = "my_thumbnail_02.png" enlarged = "large_02.swf" />
<image file = "my_thumbnail_03.png" enlarged = "" />
</images>

Detecting The End Of An External Swf File In An Empty Mc Or Loader
Hi!
Im currently trying to upload an external swf file trough an empty mc.
But since in this case i will be changing the swf file at times, i hope i could have an actionscript that detects the end of the external swf file and then gets the command gotoAndPlay(2).

thanks for reading

hope someone know how

Detecting Buttons Pressed And Writing To Text File?
Hi

I am looking for a way to track the path that users take through my site. I was wondering if there is a way to write details of the order that buttons are pressed in to an external text file?

I suspect this would require PHP which i know a very small amount of. I'm not really sure where to start.

Any help would be greatly appreciated.

thanks

Full Browser Flash Detecting Browser Size Help.
http://akmphoto.net/akmdesign_new.html

Anyone know the AS to make it automatically check the size of the browser for the listeners.... _notice when you resize the browser it works perfectly...but not when it first loads up...any ideas?

Code:
// ***Stage aligned top left
Stage.align = "TL";
// *** Stop the stage from scaling with the browser window.
Stage.scaleMode = "noScale";
stop ();
// initiate postitions and scaling values for objects
fluid._x = (Stage.width + 200)/2
fluid._y = Stage.height/2
bottomstretch._height = Stage.height;
rightstretch._height = Stage.height;
topstretch._width = Stage.width;
rightstretch._x=201;
tutoriobutton._x = Stage.width - tutoriobutton._width

bottomo._x = (Stage.width + 200)/2
// end initial position setting


//create a listner that checks to see if the browser window is resized
sizeListener = new Object();
sizeListener.onResize = function() {
// change movieclip properties when the window is resized.
topstretch._width = Stage.width;
fluid._y = Stage.height/3;
fluid._x = (Stage.width + 200)/3;
bottomstretch._height = Stage.height;
rightstretch._height = Stage.height;
//*note* 200 is the width of the left column
tutoriobutton._x = Stage.width - tutoriobutton._width
bottomo._y = Stage.height/1;
bottomo._x = (Stage.width + 200)/2;
};
Stage.addListener(sizeListener);

File Size -- Does Size Really Matter
I got this site and most of you already know about it - I have been trying and trying to crunch it -----

QUESTION:
what is a decent file size that I should be aiming on - no bare in mind that the site has imported graphics and sounds --> the lowest I can get it is 398KB ---> and that's with the sound being horrible ->

what is an ideal site usually? 250kb ---> is that even possible? I mean - sound - graphics - should I just quit?

ERRRRRRR
Low Key

Image Size / File Size
Hi there,
I´ve got a little move which holds eight *png images. The final movie size is around 200 KB.
The images are too large in size anyway, so I did the following:

Scaled the MC holding the images to 50%: No difference in movie(swf) size.
Scaled the bitmaps in Flash down to 50%: No difference in movie size.

Is there another way besides open all the images in an external editor and scale them?

Thanks, Hendrik

Bitmap Size - How Can I Know It's File Size In A .FLA ?
Hi there! thanks for taking the time.

Is there a way to know how big a bitmap
is (in Kb filesize) once imported into the library of the source FLA file ?

Sometimes I get flash tutorials with bitmaps embeded but I don't know
how to figure out how big they are? ...of course without comparing the FLA file before
and after I delete the bitmap from the library.

Thanks!

Text Size/file Size
I just realized that the "Loading Data" text I use on the 1st frame of my movie preloader weighs in at a whopping 135KB! Even the static symbol file for the Loading Data text alone is 79KB!

Does anyone know of a way to bring down the file size? It seems like I could draw something similar at a fraction of the size.

I am using a simple static font (called JH Titles) at 28pt size and tweening the brightness -100 to +100.

Cutting Down File Size In My ,swf File - And Best Importing Of Pics
Hey everyone,

I have created an swf file that is 4 mb. Everything (MC, pics, actionscripts) are in this one file which I am trying to upload online. Now I'm pretty sure this size is huge. What are some of the ways I can cut down on file size. One thing I was pretty sure that I can do, was the pics. Ok, I use a lot of vector images, and have a couple of photos. What is the file format I should be importing them as. Here are the known ways I know how to do.

1. in Illustrator, export file as a jpeg (or gif. Which is better?) then import to flash

2. in Illustrator, export file as swf file then import to flash.

3. Cut and paste directly from illustrator to the flash document.

And that is about it..

Please let me know what I can do...

Thanks

_psypent

Mysterious File Size. Swf Larger File Than Fla
hi,

heres a weird one the 50kb fla here outputs a swf of over 200k

the swf is on my website and i noticede it took a while to dowload,

weird

FLA FLA (50kb)ish
SWF SWF (200kb)ish

File Import / File Size Question
Hey everybody,

little question...i have to quicktime movies here...one is the animation itself...the other is the alpha channel of that animation and want both of that in flash...

Now what i did was compositing those anims in after effects, then exporting as a series of tga's (with alpha) then importing in flash...

the problem is that the swf explodes from around 600kB to 2.1 MB...now there must be a better way of doing this...Do flv's support alpha, if yes, how???

Greetz

Detecting Font And Font Size
I need to detect a font and font size for a dynamic text field.
My text field is called ElmText1

I thought this should work but it doesn't

ElmText1.size
ElmText1.font

I know I could find it out by first setting the font and size using the TextFormat (object) but want to avoid having to set the font this way.

All I want to do is detect it, not set it.

Anyone know how to do this?

Thanks

FLV File Size Vs Longer WMV File
When I created a FLV file of a live presentation (narrator on screen demonstrating products, etc), it came out to 8 mb for a 320x240 window size. However, one of my trainers just recorded a Camtasia (or was it Captivate, we have both) presentation, which is basically a narrated Powerpoint presentation. It is over an hour long, full screen and only 6 MB! This is a major difference. Does anyone know why this would be? I have a couple of theories, but I'd like to hear from someone else.

Flash Xml File And File Size?
I have a flash animation that pulls in images using an xml file. I was
wondering if the images must all load first? In other words, the images
are timed to load at different times. I was thinking, when I did this,
that the images would not be downloaded until they were called but I am
starting to doubt this.

Anyone have any idea how these images are loading?

Basically, my main concern is that they are putting too much load on the
homepage. I have a feeling I know what the answer is.

Thanks

Maximum File Size Of XML File?
Is their a max? I have a rather large one that is being genereated by PHP:

http://ronnieswietek.com/hosted/drewestate/dealers.php (right-click and view source).

Well with my dummy xml file everything works..when I point it to this, some of my buttons that require the xml data dont seem to be working..I have a feeling its the file size.

About File Size
I have problem regarding swf. File size.
I use all graphic converted into symbol, use minimum layer but cant control the file size.
Can u anyone tell me, How to control file size?
Is there any compressor to compress the file?

FIle Size
Hi all,
I am very new to flash, with that said I have a question. I was wondering how do I shrink my file size down. I made a 90 flash intro for a friends site and MAN it is 3 MB. I believe this is due to the fact that I have a song in it.(because the rest is mainly just text effects made in swish) The song is an MP3. I realize I am not doing it correctly but I have no clue how to fix this. Please remember I am such a n00b. Thanks,
Tom

File Size
Ok I have finally completed my site and I looked at how big it was and it said it was 150KB, well Im wondering if that is a huge webpage or is it ok. And also does flash load quicker on DSL on broadband compaird to 56K, because it seems like I am the only onew left with a 56K modem.

Thanks,
Dave Lucas

File Size? Why Is It That Big?
Hello,

I have a movie with one button which uses a dynamic Text filed. When I export it into a .SWF the file is 21k?? Why is it that big??? Can anyone tell me a way to make it smaller?

Thanks

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