Flash MX Preloader for external JPGs
Hey all! Any help would be greatly appreciated. In all
honesty, I have searched and studied and worked to get this myself,
which I do alot with code, etc. BUT I am going to admit I'm a "make
it pretty on the outside" kind of guy, and coding makes my eyeballs
fall out and well, honestly, I just don't get it. My brain can not
wrap itself around this. Sigh! So I could use your help a little.
This is what I'm wanting to do. I have a website,
www.luxeillustrato.com, and if you go to the portfolio area, and
click on any of the sections (take fine art for example); it will
showcase my works by loading external jpg files each time you click
the forward arrow button.
You can see I have preloaders on the site, that work fine. My
main page has a movie target with the instance name of photoM. You
click "artist", and it loads a new swf file into the photoM target.
IF you click on "portfolio", "fine art", it loads the fine art swf
file into photoM, using a preloader. THEN, if you click on the
forward arrow button, a new jpg image of my work is loaded into the
fine art movie target with the instance name of just
photo. As you can see, you have to wait until the jpg image
loads (and you start to wonder if it's doing anything.)
The problem is, it is not preloading the external jpgs, it's
just preloading the fine art swf. My preload code is currently:
stop();
onEnterFrame = function () {
totalBytes = _parent.getBytesTotal();
loadedBytes = _parent.getBytesLoaded();
percent = Math.ceil((loadedBytes/totalBytes)*100);
gotoAndStop(percent);
info_txt.text = percent+" %";
if (percent>=100) {
_parent.gotoAndPlay("inter");
I already have the preload animation bar created (as you can
see on the site.) What do I need to do to alter the code above (or
replace it) in order to have the external jpgs be preloaded as
well? For example's sake, let's just say I have four jpgs, titled
"door.jpg", "orange.jpg", "boyfriend.jpg", and "untitled.jpg" (in
case these are needed for the code. They may not be.)
I hope this is easy to understand. If NOT, just tell me. I'll
simplify. And seriously, thanks!
put a stop() on the first frame of your external swf in an otherwise empty first frame. when preloading is complete apply a play() to your loader's content cast as a movieclip:
function contentLoaded(evt:Event):void {
//Optionally change to a clip holder and set progressbar visibility.
addChild(contentLoader);
MovieClip(contentLoader.content).play();
Similar Messages
-
Preloader for External file Template question
I used the CS5 Flash templates>sample files>preloader for external file, to create my preloader.
The problem is that when the preloader is done and my SWF is loaded, my SWF has already started playing.
It is an animation that builds for 200 frames then buttons appear. By the time the SWF appears it has already gotten to the button frame.
Depending on connection speed I have caught the animation building.
Is there some action script I should put in my preloader or the first frame of my SWF to pause play?
Here is the preloader action:
var contentLoader:Loader;
loadContent("stage002.swf");
function loadContent(url:String):void {
contentLoader = new Loader();
contentLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loading);
contentLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, contentLoaded);
contentLoader.load(new URLRequest(url));
function contentLoaded(evt:Event):void {
//Optionally change to a clip holder and set progressbar visibility.
addChild(contentLoader);
function loading(evt:ProgressEvent):void {
var loaded:Number = evt.bytesLoaded / evt.bytesTotal;
setBarProgress(loaded);
function setBarProgress(value:Number) {
progressbar.bar.scaleX = value;
Thanks in advance!put a stop() on the first frame of your external swf in an otherwise empty first frame. when preloading is complete apply a play() to your loader's content cast as a movieclip:
function contentLoaded(evt:Event):void {
//Optionally change to a clip holder and set progressbar visibility.
addChild(contentLoader);
MovieClip(contentLoader.content).play(); -
I have a web site with a main movie that call to an external
movie.
My question is what is the action script to put a pre loader
in the main movie that will show the loading progress of the
external movie.
(now the preloader is in the external movie and its take time
until its showing the preloader and until then the page looks
empty)
Thanks in advance.Here is a sample I made that uses the progressBar component.
You could use
something similar.
http://www.smithmediafusion.com/blog/?p=31
Dan Mode
*Must Read*
http://www.smithmediafusion.com/blog
*Flash Helps*
http://www.smithmediafusion.com/blog/?cat=11
"mijal2" <[email protected]> wrote in
message
news:e2rfub$bbq$[email protected]..
>I have a web site with a main movie that call to an
external movie.
> My question is what is the action script to put a pre
loader in the main
> movie
> that will show the loading progress of the external
movie.
> (now the preloader is in the external movie and its take
time until its
> showing the preloader and until then the page looks
empty)
>
> Thanks in advance.
>
> -
Hi all I have a Director projector and when I click various
buttons this opens external files. Sometimes the external files
takes time to load. How can I create a preloader that the user can
view while the particular external file loads. Any help will be
appreciated.Hi,
Here's some info (and script) for loading assets from disk:
http://www.lingoworkshop.com/Articles/Preloading_cast_member.php
Basically, for local files, you cannot determine the progress
through a single large asset. The best you can do is monitor your
progress through a list of assets.
Another example that might be of help:
http://www.lingoworkshop.com/Articles/imageslider/Loading_Local_Images.php
-- Luke -
first try, changed somethings from previous post, tried to
make different changes, instead of using if else tried to set an
onload handler both before and after the loadmovie sentence (not at
the same time of course), copy paste of what goes on each frame
(actionscript 1):
frame 1:
setProperty("", _focusrect, false);
Stage.showMenu = false;
fscommand("showmenu", "false");
fscommand("allowscale", "true");
var mensaje = "0 %";
this.createEmptyMovieClip("pantalla", 0);
pantalla._x = 0;
pantalla._y = 0;
loadMovie("centrino2x.swf", "pantalla");
frame 2
mensaje =
(pantalla.getBytesLoaded()/pantalla.getBytesTotal())*100;
mensaje = Math.round(mensaje)+" %";
play();
frame 3
if (pantalla.getBytesLoaded()==pantalla.getBytesTotal()) {
nextFrame();
} else {
prevFrame();
frame 4:
pantalla.swapDepths(0);
pantalla.play();
stop();
the result: the if else goes right by to next frame, so it
jumps as if the movie was whole loaded, remaining in last frame as
a blank screen till the movie loads. the message appears as 100% in
the half a sec it gets on screen. according to trace, bytes loaded
and bytes total = 0
version 2, i nearly copied it from a tutorial linked from
another post, most of the preloader stuff is nearly exact from the
tutorial, uses movieloader class (actionscript 2)
frame 1:
setProperty("", _focusrect, false);
Stage.showMenu = false;
fscommand("showmenu", "false");
fscommand("allowscale", "true");
var mensaje = "0 %";
this.createEmptyMovieClip("pantalla", 0);
pantalla._x = 0;
pantalla._y = 0;
var cargador:MovieClipLoader = new MovieClipLoader();
var control:Object = new Objetc();
control.onLoadProgress = function(target, loaded, total) {
aviso.text = Math.round((loaded/total)*100)+" %";
control.onLoadInit = function () {
nextFrame();
cargador.addListener(control);
cargador.loadClip("centrino2x.swf", pantalla);
stop();
frame 2:
pantalla.swapDepths(0);
pantalla.play();
stop();
the result: it never changes frame (as if it never finishes
loading), message giving percentage loaded never appears, and
traces on event handlers for listener never come out
i have no idea what %$#"&#" is wrong, i have spend quite
a time on this, which at first seemed like the easiest part, any
pointers?when first executed pantalla.getBytesLoaded is probably 0 as
is pantalla.getBytesTotal() causing your problem.
to remedy, check that pantalla.getBytesLoaded()>0 and that
pantalla.getBytesLoaded()==pantalla.getBytesTotal(). -
What is the easiest way to preload external jpgs? The client
wants to update these frequently so they should be external, but I
want them to show up instantly like the rest of the site once the
preloading is done.
Any advice? I had thought about loading them into the
preloader (at 0% alpha), so that they'd be loaded into the cache
during preload, so that when the home page comes up, they'd be all
ready to go? But if it's a different instance of the movieclip,
will it reload the jpg? Or any time i use that external jpg in the
flash file will it already be in the cache?
Thanks. I've heard a few different things and would love your
advice.
JeremyThere are two different things here. pre-caching (I don't
know what else to call it) and pre-loading.
It is possible to pre-cache files off the same server. If you
load into different instances then it should get it from the cache,
so yes that would speed things up. But... results are dependent on
an unknown factor: the user's cache settings. If its set to never
cache you could end up downloading 'to the cache' and just wasting
bandwidth.
You can read about that approach here.
http://www.actionscript.com/Article/tabid/54/ArticleID/Preloading-Files-into-the-Browser-s -Cache/Default.aspx
Then there's the regular preload approach where you preload
into movieclips (perhaps with ._visible=false or 0% ._alpha etc).
You can find a lot of info relevant to that here:
http://www.quip.net/blog/2007/flash/actionscript-20/tracking-multiple-files-part1
http://www.quip.net/blog/2007/flash/actionscript-20/tracking-multiple-files-part2 -
Preloader whilst loading external .jpg
This is the script I use to load external .jpgs into a site
btn1.onRelease = function (){
loadMovie("Bike.jpg", _root.photo.empty);
_root.stick.gotoAndStop(80);
How would I create script so that it creates a sepaprate
preloader whilst each image is loading.for something like this it's best to use the MovieClipLoader
class, rather than loadMovie() - doing so will allow you to use the
onLoadPrgress handler to update the preloader while it's being
loaded. it would go something like this: -
Hey all! I could use any help you can give me pertaining to
the need for an external JPG preloader.
Check out my site at www.nathanaaron.com - go to
menu/portfolio/print (for example.) As you can see as you scroll
through the images, they take a bit of time to load, making you
think nothing is happening. I have a preloader in the movie file;
but it's calling external JPG files, so it is not preloading those.
I'm a bit of a simpleton when it comes to actionscripting, so any
help would be GREAT! And yes, I have searched and searched online,
but just honestly can't understand what I'm trying to do here.
Thanks!The overall preloader I'm using for loading the portfolio swf
is:
stop();
onEnterFrame = function () {
totalBytes = _parent.getBytesTotal();
loadedBytes = _parent.getBytesLoaded();
percent = Math.ceil((loadedBytes/totalBytes)*100);
gotoAndStop(percent);
info_txt.text = percent+" %";
if (percent>=100) {
_parent.gotoAndPlay("illus");
But again, this doesn't load the external JPGS. The code I
have that is loading the JPGS (one at a time) is:
this.pathToPics = "";
this.pArray = ["Port_SP_Illustration.jpg",
"ILL_TPMC_Elf.jpg", "Ill_wine.swf", "Ill_red.jpg",
"IL_art_cake.jpg", "Ill_satisfaction.swf", "Ill_mrproperty.jpg",
"Ill_child.swf", "IL_art_asbig_fade.swf", "IL_art_asbig_02.jpg",
"IL_art_asbig_03.jpg", "IL_art_asbig_04.jpg", "Ill_chorus.jpg",
"Ill_baby.swf", "Ill_father.swf"];
this.fadeSpeed = 10;
this.pIndex = 0;
loadMovie(this.pathToPics+this.pArray[0], _root.photo);
MovieClip.prototype.changePhoto = function(d) {
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
this.onEnterFrame = fadeOut;
MovieClip.prototype.fadeOut = function() {
if (this.photo._alpha>this.fadeSpeed) {
this.photo._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = _root.photo;
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.photo.getBytesLoaded();
t = this.photo.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
MovieClip.prototype.fadeIn = function() {
if (this.photo._alpha<100-this.fadeSpeed) {
this.photo._alpha += this.fadeSpeed;
} else {
this.photo._alpha = 100;
this.onEnterFrame = null;
with the forward button coded as:
on (release) {
_root.changePhoto(1);
(and back as:)
on (release) {
_root.changePhoto(-1);
MY issue is, I know coders hate designers; because I know I
could use the movie clip loader class; but you know, honestly, I
start reading about class and listeners and my brain pops! I just
don't get it. I'm good at tweaking code, but creating it is another
story all together. -
My Macbook air flash had gone for a month and I saw Apple's Macbook air flash storage drive replacement program. I'm not sure whether that program is still available for the broken device or not. Now, I'm booting from the external hard drive. Warranty has gone in October 2013..
I want to send back my macbook air back to apple store. The problem is that I bought it from US and now, I'm using it in Myanmar. If the program is free of charge for my device, it's worth trying to send back to US. Since mine is broken, I'm afraid Apple will take charges for reparing.
So, if anyone having the same problem as me, I would like to get suggestion....
Thank you!!I have no idea about how to handle the international aspect of your question.
But here is the Apple writeup about the problem and the remedy. Maybe that will help you.
http://www.apple.com/support/macbookair-flashdrive/ -
Need some free simple preloader for my flash banner or animation.
Thank's
Michel[Have a look here.|http://web.mac.com/wyodor/iFrame>
Click the Flash page. You can download the neccessary code -
Load a external jpg in BitmapData
Hello Everybody,
I search a way to load a external jpg from my server in my
swf to use
it with the BitmapData-Class.
The Method loadBitmap only works with images from my internal
library.
What do you think is the best way to solve this problem.
For me it seems to be a little bit stupid to load the image
in a MovieClip.
Then Scan the Mc to write it in a BitmapData-Object.
To Filter it. And then write it back to an MC.
Do you know a way, where I can load it directly to and
BitmapData-Object
like this:
1) load Image in BitmapData-Object
2) Filter - Image
3) attachBitmap to MovieClip
I am a noob with Flash 8 and my english is very bad.
So sorry and thanks for you help
jm//import BitmapData
import flash.display.BitmapData;
//stop movie so it doesn't repeat over and over
stop();
//load a pic into an mc on the stage
content_mc.loadMovie("flash.jpg", 1);
//create a function that runs every frame (only for this
example, it keeps running and you won't want that
_root.onEnterFrame = function() {
//this is the interesting bit, basically the next line is
your preloader 100% action, the pic has to actually have been fully
loaded before we can do this
if (_root.content_mc.getBytesLoaded() ==
_root.content_mc.getBytesTotal()) {
//create a variable to hold the bitmapdata info
myBitmapData = new
flash.display.BitmapData(content_mc._width, content_mc._height,
true, 0x00FFFFFF);
//copy the bitmap into the bitmapdata variable we just
created
myBitmapData.draw(_root.content_mc);
//now attach it to a different mc for the sake of example
_root.content_mc2.attachBitmap(myBitmapData, 1, "auto",
true);
//rotate both movieclips so you can see the difference
_root.content_mc._rotation = 30;
_root.content_mc2._rotation = 30;
supplied by myFlash83 -
Vista problem with loading external JPGs?
I'm really pulling my hair out on this one. I did a quick
flash piece for a preschool's web site and have tried several
different Flash components inside of a larger FLA file that load
external JPG files in a predefined area. With each component, I
have received complaints (so far only from Vista users) that the
user sees nothing in the area where photos are supposed to be
loading. Instead they just see a white or black box.
Is there any known issue with this? They can see everything
else in the SWF file (the swinging girl and the text), but not any
of the loaded JPG photos. Can anyone else out there with Vista tell
me that they have the same problem? I'd like to track down what the
common denominator is.
I've asked two of the users to completely uninstall the Flash
player and reinstall it, but to no avail. Deactivating Norton
Antirvirus also didn't seem to do anything.
Here is the URL:
http://www.countryvillageps.com
-- the flash item is the top banner.As Ned said the problem might be with the file structure on the server. Other problems may be with spelling. You computer may not be case sensitive to the names of the .swf files that you are loading, but your server might. So, on your computer when you are testing, second.swf is the same as Second.swf, or even second.SWF. But, on the server each of these variations is seen as a different file. Another problem is that when you are loading files from the same computer in testing, those files are close and so they load very quickly from your computer. When the files have to travel from the server, there will likely be a measurable period of time before the file is ready to be shown. This is particularly problematic with video that is embedded into an .swf. The whole file will need to be downloaded and uncompressed before it is available to play. If you stream the video as an external file, you can shorten the wait considerably.
-
Need Preloader for FLVplayback Component
Hi,
I'm playing external .flv videos using the 'FLVplayback'
component. My client's complaining that they stall and stutter a
bit when they start to stream, and wants to know if I can create a
preloader for them.
Can anyone help or point me in the right direction to create
preloaders for this component? Since the .flv is not on the
timeline, I don't know where to begin. I found some info on this in
the Flash Help files, but it's a little over my head.
Thanks very muchHey metrov,
ActionScripting is the way to go for this situation. Try this
link (hope it helps)...
http://www.actionscript.org/forums/showthread.php3?t=105158
Jaythan -
External jpg not loading when slideshow is live.
When testing locally the slideshow works fine. When i upload
the swf the external jpg do not show up. Anything graphic embedded
in the swf shows up. The external jpg don't :/
The jpgs are uploaded and all.
i use different syntax that work ok when testing locally but
no cigar when uploaded.
I can send the simple fla and jpg upon request.
Tks for your helpare you using preloader code or the onLoadInit() method of
the moviecliploader class to ensure your images are loaded before
starting the countdown to the next image load? -
Suggestion for a new macbookair flash storage capacity for dual OS
I'm planning to buy my first MBA. I'll work using logic pro and office for mac. But I also have one app that need run on win7. This app size is max 200mb.
To keep my final working file, I plan to buy external storage.
My question, looking at my work needs, pls advise what is the ideal flash storage size I should pick ? Is it 128, 256 or 512Gb ? Ideal for me means, not overcapacity flash storage.
Tx allHi Dikanug,
Out of interest, so I can further select the best capacity of Flash Storage, how many document do you plan to save on the computer using Office and how often are you going to use Logic Pro?
This will help determine the best capacity.
Obviously the Logic Pro files will need to stay on the Mac however it is probably cheeper to have a Small Flash Storage and store any file that does not need to be on the actually Macintosh Drive, stored on a large external Hard Drive with files such as Office files.
Obviously the Logic Pro files will be anywhere from 10mb -up and therefore this will be needed to be taken into consideration when purchasing the Flash.
Just for your sake: 14 tracks of audio, 10 of which are drums and a song that is about 5 minutes long, could be at least 25mb in file capacity.
Remember once you have bought the device you cannot make the capacity bigger and thereofre it is better to have more than not enough however do not waste your money if you do not need it.
Maybe you are looking for
-
It would appear that the corrupted script files are sessionstore.js or prefs.js. these i found in Application Data/Mozilla/Firefox/Profiles/2xewu6aw.default folder
-
Problem with registering Parser - Recompiled source code, don't see any changes
I had created a parser. I had register this parser with Ifs Manager. I had execute this following statement to see if been registered carefully: On user ifssys/ifssys sql)select name,stringvalue,bundle from odmv_property where name= 'p01'; I see my p
-
Calling a Transaction from a Program
Hi all. I need to call transaction VT70 and VL71 from a Program and print the Output ZBOL and ZPCK resp.(ZBOL and ZPCK are ouput types) So how to call TCODEs from Program and print them Thanks in Advance, Balaji
-
Adobe After Effects CS6 (Creative Cloud) issue
Hello everyone, One of my colleagues approached me with a problem today regarding After Effects CS6. Whenever she inserts a video the upper half turns black, while the other half is being showed properly. When the video is being played outside of AE
-
Cannot play .wav files attached to email
I see on page 50 of the iPhone manual that .wav files are supported, however, they do not play. The error I get is "this movie format not supported". Does anyone have an answer that will help me? Thanks!