ActionScript 3.0 :: Reducing TimeBar According To Time
Oct 31, 2009
I'm trying to scale my timebar according to the time. So the longer the time passed the timebar will reduce. It's kind of opposite from the preloader bar. But when I tried my loading bar is increasing towards the left. Is there a way I can make it look like the bar is reducing?
function countTime():void{
var startTime:int = getTimer();
// this is for the seconds
var seconds:int = Math.floor(startTime/1000);
// this is for the minutes ...
var minutes:int = Math.floor(seconds/60);
seconds -= minutes*60;
time_mc.scaleX= -second
trace(minutes +":"+seconds);
}
I wan't to know how to make a timebar for a game. Who knows how to do this? or is there a good tutorial for it?I want that the time stops at 1 minute (60 seconds). and the bar must go from te right (60 sec.) to left (0sec.)
I building a website and i have animations from after effects I will be importing into flash. Any time a menu button is clicked it triggers the flash timeline and plays the corresponding anumation embedded in different flash graphics. Also before the webpage moves to the main page an Flv is streamed (90seconds log. It is not embedded it is streamed). I have about 260 frames of jpegs Already compressed to about 70k each for each image. how I can reduce my file size? also my time line is 2750 frames long. This is for a client and the client requested all the animation, so how can I make this work, currently my swf file is 14.6mb
I could really use some help here, I'm trying to reduce the size of my animation for obvious reasons, usually ends up about 4mbs, im exporting from swift 3d, about 200-250 frames depending on editing. When I import the animation into flash to work with my website the resulting file is too large I think :P I was told to export from swift in avi and then import to flash after converting. Thats definetly reduced the filesize, but when I import to flash cs5 I get an empty symbol even after export from flash, nothing shows in the symbol.Can anyone tell me if im doing this right, or another way to reduce the filesize.
I have a game were there are a lot of little guys moving around on the screen independently of each other and I have a function for zooming in and zooming out. I want the guys to look good when I zoom in but not lag when I zoom out and show a lot of them. What I'm thinking of doing is just making different levels of detail that it uses for the guys at different zoom distances.I don't know what makes vector graphics lag. Is it the number of shapes it has to redraw every time something moves? Or is it just determined by the number of objects on the screen at a time regardless of detail? I want to know if it would make a big difference in lag before I go redraw everything because it would be a big task and I don't want it to be for nothing.
I am making a websites with fairly large videos in the background.The site is extremely heavy for the cpu and I was wondering if any of you guys know a trick on how to make flv streaming less heavy.Here are all my specs :
Large flv (920 x460), with alpha channel (transparent background), Max data rate:300kbs, codec : On2 VP6 encode alpha channel, framerate : same as source.
Using progressive download
Video plays in a flvplayback instance nested in a swf that is loaded and added to the stage by an other swf.
Embed in the html page with swfobject, wmode = opaque.
I have a 3D animation that is rendered to bmp frames.I have inserted the animations into a Flash doc.After editing, my final Flash movie/file is 20MB.what are the best ways of reducing or compressing the file size down to a resonable "web-ready" level? Around 8MB or lower
I imported a clean looking high-res jpeg into Flash CS4.Then using properties, I reduced it with the position and size function.I reduced it by half.When I do this, the image is not clean and sharp any more but pixelly.In the image the arrow points to the reduced image on the stage and when previewed.Also, you'll see the size numbers display too.If I need to reduce images and logos like this, is there a better way to do this so the image looks sharp when reduced?I am only interested in knowing how to do this using the "tools" not actionscript.
some buttons which are cloud shaped. When I import them from photoshop as pngs they some with a square tranparent backgroud.This makes the "hand" appear outside the cloud shapes as well as inside them (like it should).
At my job I frequently have to create Flash banners for major newspaper's websites. The specs that usually come in require a max file size of 30k or so. Usually my art department will hand me 3 or 4 screens that they want to simply move through in a loop. No biggie, until they start adding images to the files.
When I complain to them that the images are making the file sizes too big I am usually queried as to how other advertisers on these sites have full video in their ads. I understand that there are pre-loaders as well as allowed larger file sizes if you pay more for the ads.
getting image sizes down in Flash so that the images don't end up looking horrible?
I have a sound running on a timeline and I want to have an AS2 script that will reduce the volume by, say 50%, and have the reduction in volume happen over a number of seconds so it is not an abrupt change.
I created a file which has several songs and these songs are 3 minutes in length each. Currently, these songs are looped forever. If I make it not loop, would that decrease the size of the file?
I created a movie clip button that contains 2 text fields, one static and one dynamic. The dynamic text field holds strings that will vary in length. This MC in general is used as a button so what im trying to do is not have the hit area as large as the length of the text box.
If you go to http:[url].... and click on (takeout > menu) you will see on the menu all the items listed are overlapping onto the picture, i want to limit the hit area so that does not happen. I cannot shorten the MC because it will vary in length, and if it does become that long then that portion should not be clickable.
I've got an XML file which is sitting at about 300k and will only get bigger. The tag names are quite verbose so it's frustrating because it's obvious the file size would be a lot smaller if those tag names were only a couple of characters long.I'm not sure if I'm using the term "tokenizing" right, but does anyone know of a method to convert verbose text into a series of unique shorthand "tokens" or markers... and back again? I don't want to change the tag names as the logic within flash refers to them so it would mean an annoying rewrite.
I have a mov file that's 125 megabytes. I try running it on my page within a javascript scroller animation and the animation is very choppy and in fact I used css to simulate a mask but the thing doesn't get masked, probably do to the sluggishness of whole page, the page never fully loads, and the movie file makes it nearly impossible to scroll through the page. The file is just too huge.
My question is:
1) Should I convert the mov to swf - that is, is swf a more compatible and appropriate format for seamless integration in html web page?
2) Whichever I choose, how do I reduce the file size - like on youtube where the videos run seamlessly? I don't know how they are doing that.
I do have Adobe Flash CS4 Professional, if that matters.
I notice that Flash makes changes to a stage size to the right. Is there a way of making the change so it expands out from a central point, i suppose like photoshop and similar. This has caused me some problems in the past when a client has asked for the site to be increased or reduced in width for example, and it can take a considerable ammount of time to move everything accordinly
I have used printjob in my project for printing. I have a stage with images, shapes and text etc in printing group. While printing, it takes some two to three minutes to getting print a single page. The Print Spooler window shows that 60MB for each page.
reduce this file size or how can i print without taking this long time.
I am creating a site with lots of big scrollable text-boxes in it. Each text-box object contained some text, and two buttons to scroll up/down with. The scroll buttons each had an event listener so the text moved when you clicked them.
These text-boxes were stacked on-top of each other with all except one having an alpha of 0. If I wanted to change which text-box is active I move it to the front and call a small TweenLite animation.
To the left (outside of the text-box objects) I have an object similar to a menu. It also has about 12 or so event-listeners (one for every button). This turns out cause A LOT of lag an it's very troublesome for my laptop to run it. What I need help with doing is to reduce the number of event-listeners on the stage and also the amount of text-boxes.
What I was thinking was to add the text-boxes using AS so I only have 1 on the stage at a time but I couldn't figure out how to do it. I also thought it might be better to just use 1 big event-listeners and from mouseX and mouseY decide which button the user is trying to push.
I have got the sound functionality working for two sounds in my embedded movie clip, each controlled by their own on-off button.I need to add this for another 20 or 30 sounds in the movie clip.I have the feeling there is a way of reducing the amount of code here using variables and/or arrays.
I'm building a Flash site that features a three-dimensional interface and I'm facing a significant file size problem, which will mean serious bandwidth problems when the site is online. I don't particularly want to go the route of actually bringing a 3D object into Flash, mainly because my object features transparency (it's made from glass) and papervision3d confuses me to no end. So I have two options: import as video or import as image sequence.
So I went with the image sequence idea. It was easy for me to give the viewer the ability to scrub back and forth through the looped animation and click on certain things at certain times (using invisible buttons). This gives the appearance the viewer is in a three-dimensional word, albeit on a fixed path backwards and forwards, much like a roller coaster
There's also an array of buttons down the bottom of the website that you can click on, and it will play through the image sequence (either in forward or reverse). So that works great, but even with high compression of jpegs and a low 12 fps, the swf file will be somewhere between 10 and 30mb, which is quite ridiculous!
Possible solutions include reducing the amount of images I use in the sequence, squishing it down to half the amount of images. Reducing the size of the images down to something smaller, like 800 x 600. But do you think I would get better results if I can import this as a movie instead and try to control the movie? Can I have the same control if it's an actual video file and not an image sequence?
I've been making a flash animation for a client - the dimensions of the stage are 2,000px wide, 800px tall. They want a graphic in the background and a snow effect in the foreground.
The code I have written uses TweenMax to move a snowflake that has been dynamically loaded from the library on to the stage using attachMovie. When the clip leaves the stage, it is deleted and a new clip is created at the top of the stage.
I expect flash to redraw the background that the flakes pass over, but flash seems to also be redrawing space between the flakes - as if they were one movieclip - even though they are separate instances.
I'm trying to get it so whenever the object is clicked it reduces in opacity by 10% each time, and if it gets to 10% and it's clicked again it stays at 10% instead of going to 0. I got it to keep going down in opacity fine I just don't know the code to keep it from going lower. this is what I have so far
function fadeOut(e:MouseEvent):void { instrument.alpha -= .1; } if (instrument.alpha<.1) { instrument.alpha = .1 } else { instrument.alpha -= .1; }
I'm trying to achieve a thumbnail gallery which basically reduces it number of columns (and increases number of rows) when the stage is being resized down.The columns number as default 5, but after resizing down the stage this number is calculated like this:[code]My question is how can I reorder the the columns and rows from the onStageResize function.[code]
I'm building a Flex project with a lot of embedded bitmaps and such. The usual method for getting to the bitmaps in Actionscript seems to be to do something like
[Bindable] [Embed(source = '../lib/WhiteFencePost.png')] private static var clsObstacleFencePost : Class; var bitmap : BitmapAsset = new clsObstacleFencePost();
I've already got several dozen of these things, and I can easily see ending up with hundreds of them by the time the project's done. Is there some way that I can avoid creating a Class for every bitmap?
// Edit: The issue now appears to be confined to Safari for Windows.
Around the time Safari for Windows 4 came out I started hearing from users that wmode=transparent was no longer working in Safari.I have tried reducing interference by using tags as opposed to scripts to embed the Flash but with no success.An example is here: [url]... alternately embedded with script at http://hiv411.org/
All videos use wmode=transparent and are embedded via tags. All work fine in every browser I have except Safari.Code looks like so on safari.php
I have this clock code and would like to know what needs to be added or changed for it to reference the time off the server and not the local computer time (and preferably reference the server just once and not repeatedly). I already have a file on the server "time.php" that is providing the milliseconds. I know it should be fairly simple, but I just can't wrap my head around it.
Both of these are saved in files with the name same as the classes.
Both are saved a folder which also contains an fla file name hello.fla.So,when test the movie(hello.fla),after choosing the document class as WavyBall,I get these errors: 1046: Type was not found or was not a compile-time constant: Ball.
Source: var Ball:Ball; 1120: Access of undefined property stage. Source:Ball.x=stage.stageWidth/2; 1120: Access of undefined property stage. Source:Ball.y=stage.stageHeight/2; 5000: The class 'WavyBall' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.What is wrong?
I have a fairly complex animation movie clip within my main timeline in a Flash file. When you click a button, it plays the movie clip, then goes back out to the main timeline. The first time the movie clip runs, it plays choppy and slow, but if I play it two or more times, it plays correctly (smoothly). Is there some actionscript I need to preload the movie clip, or some other solution to the first-run slowness?