ActionScript 2.0 :: Adding Image Counter To Preloader
Oct 20, 2010
I have a preloader on the first frame. It works great, with no problems and it's loading images from a directory. I would like to add to it an image counter, not only the bytes that are loading.
Actionscript Code:
stop();
// array of your movieclips$
mcs = ["page_1.jpg", "page_2.jpg", "page_3.jpg", "page_4.jpg", "page_5.jpg", "page_6.jpg", "page_7.jpg", "page_8.jpg", "page_9.jpg", "page_10.jpg", "page_11.jpg", "page_12.jpg", "page_13.jpg", "page_14.jpg", "page_15.jpg", "page_16.jpg", "page_17.jpg", "page_18.jpg", "page_19.jpg", "page_20.jpg",
[Code] .....
So, basically I would like to add another dynamic text box in which - as the images are loaded - I would like to have a counter for the images.
View 1 Replies
Similar Posts:
Sep 6, 2010
I am trying to build a simple preloader. I have 4 movieclips on stage and on each one I am adding an image that comes from an xml file:
theMap = new XML();
theMap.ignoreWhite = true;
theMap.onLoad = function(success){
if (success) {
theNodes = theMap.firstChild.childNodes;
[Code] .....
Everything works ok but as the jpgs are a bit heavy I'd like to preload them. Is that possible?
View 1 Replies
Jun 8, 2005
I'm working with the php hit counter here on the Kirupa site and wondered if there was a way to test the data in the txt file during the loop to determine playback of a movieclip.... in other words, when the loop starts, a variable is created storing the number in the textfile... the next time the loop repeats, the textfile is checked and matched against the variable... if the variable differs from the textfile, the variable value is changed to match the textfile, and a movieclip plays to signal that this change in the textfile has occurred.
View 8 Replies
Nov 28, 2011
I've looked all over the web and everyone can teach you how to make a timer for your game or a countdown, but I can't seem to find out how to add time to an already counting timer. So here is my counter class:
package {
import flash.display.MovieClip;
import flash.display.Stage;
import flash.text.TextField;
import flash.events.Event;
import flash.utils.Timer;
[Code] .....
That works without any issues or problems and just keeps counting upwards at a speed of 100ms, what I want to know is how to add say 30 seconds if something happens in my game, say you kill an enemy for example.
View 2 Replies
Jan 21, 2009
Is it possible to add kerning (letterspacing) in-between the numbers in a date counter? For example lets say I have a date counter that counts the dates of a month (1,2,3,etc...) and I have two circles sitting side by side not overlapping. How would i go about adding a space in-between the numbers to have the number on the left in the left circle and the number on the right in the right circle? Someone mentioned using strings but how would I go about doing that? Here is the current code that I am using:
[Code]....
View 1 Replies
Apr 24, 2009
How do i make this problem solved
problem.gif (72.44 KiB) Viewed 381 times
View 3 Replies
Nov 11, 2010
I want when someone clicks the prev_btn for it to load imageCounter-1".jpg", but I do not know how to propperly code this. Also, is there a way to have a fixed positon for the loader's Y and also have it's X centered? The images are all the side hieht, but the widths are different.[code]
View 7 Replies
Jan 20, 2010
I have a very simple flash movie.
24 png images in the Library The image properties are set to 'Export for Actionscript' and the class named 'image1', 'image2' etc Single frame in the timeline
I need to dynamically load 'image1' on the stage at the start of the movie. I have been able to do this using BitmapData ojects.
On clicking the image, I need to increment an internal image and replace the image on screen with image2.
When I try to pass the library class as a variable it throws an error.
View 2 Replies
Mar 28, 2009
I'm new to AS3, but our teacher thinks we're all amazing geniuses and assigned us this project which was due last class. Great, I know, I have to do it even if it's late. Only 5 students out of 28 were able to finish the assignment.[code]Those are all the assignment details he gave us.All I have so far. What I have only adds the array to the list. Nothing much else.[code]Also, when the array prints on a new line, the prior item on the array must not print as show above.
View 6 Replies
Oct 25, 2009
Is there an easy way to add a preloader to everything? so all my images, swfs and images within my swfs all have the same preloader?
View 1 Replies
Sep 10, 2009
Ok so I have this XML gallery working perfectly, but I want to add a preloader to it. I have the loader and child all in one package, and that package is called via back and forward buttons according to if/else statements that ensure that the xml gallery does not get confused. I figure ok, so it's simple, I just add the preloader into the package using if/else statement, but I can't seem to get it to interact with the imageLoader I have set up in this package. As it stands right now I get no compile errors, but I do get an output error at runtime stating that packagedF and xmlLoadedF are now null object references. Take a look and see if you can figure out what I'm doing wrong:
ActionScript Code:
stop();
var xmlRequest:URLRequest= new URLRequest("graphicImages.xml");
var xmlLoader:URLLoader = new URLLoader(xmlRequest);[code]......
View 0 Replies
Apr 8, 2005
I am making a flash animation/movie that is about 1.4MB in file size, there is also music that plays along with the animation, but the MP3 file is about 2.4MB, so I called up the loadSound function (streaming) in the first frame, and toggled the Sound start function when the PLAY button was pressed. The PLAY button only appears once the preloader has loaded all the frames of the flash file, but it does not wait for the MP3 to finish loading.
If the user clicks on the PLAY button before the MP3 has finished loading, it won't play the MP3.
If the user waits a few seconds for the MP3 to finish loading, the MP3 plays normally.
Is there a way to make the preloader load and/or calculate the MP3 as well as the animation?
Code:
// variable to hold the value of total frames in this movie
var loadAmount = _totalframes;
// loops until the frames loaded >= to frames in this movie
if (_framesloaded >= loadAmount) {
[Code]....
View 1 Replies
Apr 8, 2005
I am making a flash animation/movie that is about 1.4MB in file size, there is also music that plays along with the animation, but the MP3 file is about 2.4MB, so I called up the loadSound function (streaming) in the first frame, and toggled the Sound start function when the PLAY button was pressed. The PLAY button only appears once the preloader has loaded all the frames of the flash file, but it does not wait for the MP3 to finish loading.
If the user clicks on the PLAY button before the MP3 has finished loading, it won't play the MP3.
If the user waits a few seconds for the MP3 to finish loading, the MP3 plays normally.
Is there a way to make the preloader load and/or calculate the MP3 as well as the animation?
Code:
// variable to hold the value of total frames in this movie
var loadAmount = _totalframes;
// loops until the frames loaded >= to frames in this movie
if (_framesloaded >= loadAmount) {
[Code]....
View 1 Replies
May 13, 2010
I was given the task of adding a preloader to an already existing flash website. The website is completely in flash. Each "page" is on a layer and are made of animated movie clips. It is a portfolio website, so some pages take a while to load up. That's where the preloader comes in. I want to put a preloader at the very beginning of the page that will play as the entire site is being loaded, so when the user clicks through, each page shows up quickly and seamlessly.
I have created a preloader in a separate flash file, but can not get it to work with the website. How do I combine these two files to work?
View 1 Replies
Oct 22, 2009
I am a newbie and been developing this menu that is XML driven and uses an External AS file for the script, so there is no AS on the timeline, it is all external. The Preloader. I found this preloader from here: [URL] which I have been trying to build into my movie, but with no joy! I don't understand how to add a preloader when you have external script, there is going to image directly on the stage, which is what the preloader would be loading.
Basically all I would like to do is add a simple percentage count for the preloader, a loading bar also would be great, but if not ,thats ok. The problem I have is when I put the preloader script into my existing menu all hell breaks loose. Below is a link to my menu files and also attached the AS script file, if that is better? Link to menu files: [URL]
Attachments: Main.zip (1.5 K)
View 1 Replies
Aug 30, 2010
If I already have an existing movie, what is the best way to add a preloader to this movie?I have 1 frame with a few layers right now. Then, I have some movie clips on frame 1 Should I just move everything to frame 2? Does that throw anything out of sync? I am using labels in the movie clips that that I can use gotoAndPlay("label");
View 5 Replies
May 5, 2011
I've got a Flash AS3 animation that is completely coded in an .as file. The only thing on the timeline is the background image. All of the movieclips are Exported for ActionScript in frame1. How would I go about adding a preloader into the .as file? I have tried a couple that I've found through Google but they don't seem to work as the .as file seems to be loaded instantly.
[Code]....
View 2 Replies
Feb 23, 2010
I need to create a gallery to load images and display them. This part is fine:
/**
* @variable image_name to store the name of the selected item
*/
private function showimage(evt:Event):void
[Code].....
where imgMain is the id the image component.
But, I need a small twist. A transition image i.e. loading image should be displayed while the the image is being loaded.
View 1 Replies
Mar 24, 2012
I'm trying to make a navigation system for my website where each nav item is loaded as an external .swf. I was able to get that functionality in place. The problem is I want to add a preloader for these external swfs as well.
The code I'm working with is this:
var loadedSWF:Loader = null;
/**
* Loads an SWF and adds it to container once complete
* @param file The URL to the SWF to load
[Code].....
View 1 Replies
Apr 29, 2010
I am making a site in flash. Without a preloader everything appears on the stage fine. Once I add a preloader I can no longer see certain things on the stage. I know they are on the stage because I can call them through code and I traced their getChildIndex and they are the same across both files. Files w/ preloader and problem:[URL] The main file is Test.fla. The code that adds the objects that I cannot see is in Test.as and the objects that I cannot see are menuBG, menuBGL, menuBGR, menuBGB, shader, grid, and imageStatus, or anything that is imported from the library.
Edit: The problem is caused by me exporting my classes in frame 2 which is needed by the preloader. In my init() function I tried adding gotoAndStop(3);
View 2 Replies
Mar 5, 2012
ERROR 1046: Type was not found or was not compile-time constant:textline.
I have nested my animation into a movie clip and have tried to use a pre-loader on it. The nested movie clip opening screen as a button on and the second screen as back and forward buttons. The movie clip works fine no problem until adding it to the pre-loader. The code for the pre-loader is (below) on frame 1 frame 2 to is tells it to stop and also were my nested movie clip is
function loadProgress(my_content:ProgressEvent):void {
var percent:Number = Math.floor( (my_content.bytesLoaded*100)/my_content.bytesTotal);
myLoadText.text = percent + "%";
} function loadComplete(e:Event):void {
currentFrame + 1;
} loaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
loaderInfo.addEventListener(Event.COMPLETE, loadComplete);
View 1 Replies
Aug 11, 2010
I'm trying to add a preloader to my flash movie so the user doesn't have to wait for additional frames to load while they are navigating. When I try to shift my current frames over by 2 frames to make room for the preloader I get this error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at APIVisionDigitalRecall_fla::MainTimeline/frame3()[APIVisionDigitalRecall_fla.MainTimeline::frame3:20]
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()
at flash.display::MovieClip()
at navBar()
Everything works fine before I shift the frames by 2, so I don't understand why I'm getting a complier error abut an object not existing. What to do to add a pre-loader to my existing movie without moving everything over by two frames?
I was planning on putting this code on frame 1:
ActionScript Code:
var kbtotal:Number=stage.loaderInfo.bytesTotal/1024;
var kbloaded:Number=stage.loaderInfo.bytesLoaded/1024;
var percent:Number= Math.round(kbloaded/kbtotal*100)
loader.gotoAndStop(Math.floor((precent/100)*100));
loader.loadingStatus.text=Math.round(kbloaded) + " lb / " + Math.round(kbtotal) + "kb";
This code on frame 2:
ActionScript Code:
if (kbloaded == kbtotal){
gotoAndPlay("Main");
} else{
gotoAndPlay("Load");
}
View 3 Replies
Mar 30, 2009
I am new to flashCS4 and done 2 of lee's tutorial's and have 2 questions.
1) how/where do I add a preloader to file when each vid is clicked on ?
2) how do I set a mc to be seen as a button in browser when you mouse over it ?
VideoGallery: [URL]
AS Code:
Select allstop();
hum1.addEventListener(MouseEvent.MOUSE_DOWN, vidStart1, false, 0, true);
hum2.addEventListener(MouseEvent.MOUSE_DOWN, vidStart2, false, 0, true);
hum3.addEventListener(MouseEvent.MOUSE_DOWN, vidStart3, false, 0, true);
hum4.addEventListener(MouseEvent.MOUSE_DOWN, vidStart4, false, 0, true);
[Code] .....
View 2 Replies
Apr 18, 2007
[URL] The website button function and External swf transition scripting is base on that tutorial. it would be great if i could let peoples to see the preloading process while my web loading the external swf file.. can any one here tell me how to add a preloader to show loading progress every time the external swf files loading?
View 2 Replies
Nov 23, 2009
i am in the midst of working on a game, and i need a preloader .i have one that works fine, it's a pic and some text with a load bar and a % value shown. but i don't want a damn bar, there evil!!! so i want to fill-in the white space with light green, is there an easy way to get this done?
View 1 Replies
Sep 28, 2009
I am not having much luck creating a link for an icon image on my site. What would be the easiest way to create a URL link to an image?
View 1 Replies
Jul 25, 2007
I have a simple website and use XML to add text content.To add an image I have been using the following code: Code:<IMG SRC="golf6.jpg" WIDTH="100" HEIGHT="80" BORDER="0">Is this the best way to add an image?The image is added but the text flows around it rather than starting a new line after it.
View 6 Replies
Aug 11, 2009
how do i make a preloader for one image in my file?
View 3 Replies
Mar 31, 2009
I am a little stuck as to where to begin; I have created aphoto gallery and now need to add some preloader capability to it.The images are brought in via XMLList etc... What I have in mind, Iwould like to display a preloader untill all the images are readyfor viewing - not wanting to preload individual images one by one)I also have a document class within the gallery swf file, Ibeleive that this may cause conflicts with attaching a preloader toframe 1 - I have tried preloading the gallery swf file via apreloader.swf; the end result still leaves me with having toprovide a preloader within the gallery swf.Can anyone point me to any good examples, for me to get on
View 16 Replies
Jun 19, 2009
I have made a random image loader for a slideshow, but the preloader does not work for it (I grabed the preloader from a previous website I made) Is there a way to preload the images or the slideshow and/or have the next image pre-load while the current image is playing. I have attached a zip file of the random image loader
View 10 Replies