Preloader not working in Safari , works fine in Firefox?


my site is comprised of several images loaded dynamically and added to the display list. i declare a bunch of loaders on the first frame, and add a preloader progress listener to the largest image to have one preloader for all the assets. I then added a COMPLETE listener to the same image, and add that image, along with all the others in the onComplete function. i have two issue. the preloader doesnt work in Safari. but works fine in Firefox and i'm totally stumped on what it could be another compatibility issue that seems to be arising is that one of the galleries of my site which corresponds to the "drawn" link. also does not seem to be working in Safari, but works in Firefox. its a fairly simple xml based image gallery, which loads thumbs on to the stage, and then loads a larger version of each, when the corresponding thumbnail is clicked. the other galleries of the site work fine in safari, and are basically the same code wise.

heres my code for the loading and preloader in the first frame

Code: import caurina.transitions.*; stop(); // declaring loaders for BG images var backgroundImage:Loader = new Loader(); var _targetLoaderInfo:LoaderInfo; _targetLoaderInfo = backgroundImage.contentLoaderInfo; // preloader graphic var preloader:Preloader = new Preloader; var animationLink:galarrowleft = new galarrowleft; var digitalLink:galarrowright = new galarrowright; var sketchLink:sketchlink = new sketchlink; var resumeLink:resumeMainText = new resumeMainText; // loader instances for BG image assets var clouds1:Loader = new Loader(); var clouds2:Loader = new Loader(); var bottomPark:Loader = new Loader(); var topRibbon:Loader = new Loader(); var Haze:Loader = new Loader(); var digitalBG:Loader = new Loader(); var nightSky:Loader = new Loader(); var midCity:Loader = new Loader(); var stars:Loader = new Loader(); var moon:Loader = new Loader(); var sun:Loader = new Loader(); var topPlanet:Loader = new Loader(); var sketchBG:Loader = new Loader; var sketchBorderR:Loader = new Loader(); var sketchBorderL:Loader = new Loader(); var Title:Loader = new Loader(); // declaring a variable for the bytesloaded to bytesTotal ratio needed for preloader progress var _loadPercent:Number; //Loading initial BG images stars.load(new URLRequest("img/Site2dElements/nightOrn.png")); moon.load(new URLRequest("img/Site2dElements/moon.png")); midCity.load(new URLRequest("img/Site2dElements/site_BG_Mid5.png")); sketchBG.load(new URLRequest("img/Site2dElements/DigitalGalBG.png")); sketchBorderR.load(new URLRequest("img/Site2dElements/sketchBorderR.png")); sketchBorderL.load(new URLRequest("img/Site2dElements/sketchBorderL.png")); digitalBG.load(new URLRequest("img/Site2dElements/DigBorder.png")); sun.load(new URLRequest("img/Site2dElements/sun1.png")); clouds2.load(new URLRequest("img/Site2dElements/clouds4.png")); topPlanet.load(new URLRequest("img/Site2dElements/siteBorder_top.png")); Title.load(new URLRequest("img/Site2dElements/3dHeader.png")); Haze.load(new URLRequest("img/Site2dElements/SiteOuterHaze2.png")); topRibbon.load(new URLRequest("img/Site2dElements/siteRibbon.png")); backgroundImage.load(new URLRequest("img/Site2dElements/bluesky.png")); clouds1.load(new URLRequest("img/Site2dElements/clouds1.png")); bottomPark.load(new URLRequest("img/Site2dElements/siteBG_bottom.png")); // position and add preloader graphic to display List preloader.x = 726; preloader.y = 350; addChild(preloader); // preloader flashes unless its visibility is turned off preloader.visible = false; _targetLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressListener); function progressListener (e:ProgressEvent):void{ _loadPercent = _targetLoaderInfo.bytesLoaded / _targetLoaderInfo.bytesTotal; preloader.visible = true; preloader.progBar.scaleX = _loadPercent; percent_txt.text = Math.ceil(_loadPercent*100).toString()+"%"; } backgroundImage.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete); function onComplete(e:Event):void{ // clean out preloader assets removeChild(preloader); removeChild(percent_txt); percent_txt = null; _targetLoaderInfo.removeEventListener( ProgressEvent.PROGRESS, progressListener ); _targetLoaderInfo.removeEventListener( Event.COMPLETE , onComplete ); // positioning, and adding all loaded assets var resumeLinkX:Number = 710; var resumeLinkY:Number = 60; var digitalLinkX:Number = 610; var digitalLinkY:Number = 75; var animationLinkX:Number = 850; var animationLinkY:Number = 60; var sketchLinkX:Number = 490; var sketchLinkY:Number = 50; addChild(backgroundImage); addChild(clouds1); addChild(bottomPark); addChild(Haze); addChild(topRibbon); addChild(Title); addChild(animationLink); addChild(sketchLink); addChild(digitalLink); addChild(resumeLink); Title.x = 425; Title.y = 125; digitalLink.x = digitalLinkX; digitalLink.y = digitalLinkY; animationLink.x = animationLinkX; animationLink.y = animationLinkY; resumeLink.x = resumeLinkX; resumeLink.y = resumeLinkY; sketchLink.x = sketchLinkX; sketchLink.y = sketchLinkY; animationLink.alpha = 0; digitalLink.alpha = 0; resumeLink.alpha = 0; sketchLink.alpha = 0; Title.alpha = 0; Haze.x = 0; Haze.y = 0; clouds1.x = 0; clouds1.y = -1200; bottomPark.x = 0; bottomPark.y = 240; topRibbon.x = 0; topRibbon.y = 0; backgroundImage.x = 0; backgroundImage.y = 0; // proceed in timeline gotoAndPlay("main"); }
any insite on what the problem could be or if i'm just missing a compatibility thing with Safari, i would much appreciate

Posted On: Thursday 25th of October 2012 10:11:48 PM Total Views:  96
View Complete with Replies

RELATED TOPICS OF Flash / ActionScript PROGRAMMING LANGUAGE




flash preloader

Hi New guy here from flash..can anybody teach me how to use the preloader component I did some research on tons of preloaders but until now, i don't have any success
VIEWS ON THIS POST

81

Posted on:

Saturday 20th October 2012
View Replies!

Multiple preloaders

I followed a tutorial to get a preloader off here for my movieclip however i have several and wondered if its possible to add a listener to all of them Ive got it working on the colourLoader_mc and ive tried alsorts but cant get it to work on the others as it only works on whatever the last movieclip is. Heres my code: ActionScript Code: MovieClip.prototype.fadeIn = function() { this.onEnterFrame = function() { if (this._alpha
VIEWS ON THIS POST

84

Posted on:

Saturday 20th October 2012
View Replies!

preloader problem

Hi , I have developed a flash website around ( 5mb) which is working properly and I added a preloader on the first frame, and the rest of the code in on second frame. onClipEvent (load) { total = _root.getBytesTotal(); } onClipEvent (enterFrame) { loaded = _root.getBytesLoaded(); percent = int(loaded/total*100); msg.text = ""+percent+"%"; gotoAndStop(percent); if (loaded == total) { _root.gotoAndPlay(2); } } however, the preloader doesn't work. I just get a blank screen until the site loads. I found that the preloader works for the swf file which is smaller then 4mb, but not large then 4mb. what is the problem anyone can help I have looked for many forum and website, but still can't find the answer. This is the zip file which contains the fla and html http://karlie.hk/pop/pop-up.zip
VIEWS ON THIS POST

136

Posted on:

Saturday 20th October 2012
View Replies!

Can someone explain the logic of a preloader for me

i have searched the net so please dont post links as i have probably read the article. Basically we have a website created in scenes, the main swf file is 3mb. So from what i understand about downloading files, the end user will have to download the whole 3mb before they see anything on screen as everything is contained within on swf file. Now for a preloader would i be creating a completely seperate file which will be much smaller, eg 40kb. So that the user will first download this 40kb file and then it will download the bigger 3mb file in the background and give the user a nice loading bar. Is this correct Or is it possible to have the preloader contained within the large 3mb file, that will download first and display progress of the download help appreciated and sorry if i confused anyone
VIEWS ON THIS POST

86

Posted on:

Wednesday 24th October 2012
View Replies!

preloader problem

Can someone tell me where I am going wrong with my preloader I followed a tutorial to get this far but it throws up all kinds of errors when i test movie. I think the tutorial was for cs3 and i'm using cs4 which may be the cause of the problem. my .fla file is here.
VIEWS ON THIS POST

134

Posted on:

Wednesday 24th October 2012
View Replies!

slide screen preloader

hello, I have a seperate swf for my pre loader. It's just a text layer and an actions layer with this in the first frame. (I am using the slide screen presentation template) Code: var l:Loader = new Loader(); l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS. loop); l.contentLoaderInfo.addEventListener(Event.COMPLETE. done); l.load(new URLRequest("Presentation1.swf")); function loop(e:ProgressEvent):void { var perc:Number = e.bytesLoaded / e.bytesTotal; percent.text = Math.ceil(perc*100).toString(); function done(e:Event):void { removeChildAt(0); percent = null; addChild(l); } It gives me this error 1084: Syntax error: expecting rightbrace before end of program. If you need more info let me know. And I really hope you can help
VIEWS ON THIS POST

89

Posted on:

Wednesday 24th October 2012
View Replies!

I need help with a preloader

I've been working on a website in Flash for quite some time and since I'm a newbie it's been quite large. I have different swf for different areas, so I'm planning to have apreloader when you are leaving one area entering a new area. But when I was almost ready with my site and discovered I didn't know how to make the preloader correct, I kinda got stuck and haven't done anything for weeks. So, I'm here calling for help. And I guess it's not that hard either. Let's say you come to my start page. I need a preloader which is loading an external swf file. I have a movie clip with frames 1 - 100. There is a car moving from left to right during these frames. So, what I need is a preloading code that is looking at my movie clip and move it for every % that is loaded of the swf file. So, if I want to load 'start.swf' (which is 5 Mb), I would like the car to move from left to right (frames 1 - 100) during the loading process. So what should go into the Action Script to make this work The movie Clip is called 'CarClip'. I've been playing around in Flash for fun and I'm the old school old man who is working in ActionScript 2. Another question. Would it be possible to make the preloader not run too fast Since, if you leave stage one on the web site, entering a new area, then I am planning to open a new preloader with another car. But if part two of the web site is smaller than the first one, I wouldn't like the car to just run away too fast. It would be nice if it's possible to set a limit to the loading process also. But if that's a hard thing to do, then I'm more than satisfied getting help with my first problem here.
VIEWS ON THIS POST

88

Posted on:

Wednesday 24th October 2012
View Replies!

image fill preloader

When clicked, I want my logo to fill with it's colour as the site loads. Can anyone tell me how to this, or point me toward a tutorial (using AS2) Cheers!
VIEWS ON THIS POST

114

Posted on:

Wednesday 24th October 2012
View Replies!

CS3 TypeError #1009 when using a preloader

I keep getting the same error message ever since I tried adding a preloader. Everything seems to function properly, but obviously there's something wrong. Does anyone know how to fix this TypeError: Error #1009: Cannot access a property or method of a null object reference. at CaptainSUL_fla::MainTimeline/onProgress() heres my script: stop(); this.loaderInfo.addEventListener(ProgressEvent.PRO GRESS, onProgress); this.loaderInfo.addEventListener(Event.COMPLETE, onComplete); function onProgress(e:ProgressEvent):void { var loaded:Number = e.target.bytesLoaded; var total:Number = e.target.bytesTotal; var pct:Number = loaded/total; loader_mc.scaleX = pct; loaded_txt.text = "Loading..."+(Math.round(pct*100))+"%"; } function onComplete(e:Event):void { gotoAndStop("2"); }
VIEWS ON THIS POST

147

Posted on:

Wednesday 24th October 2012
View Replies!

Yet another preloader question.

So I'm in day four of Flash class, and have never used the product before. Instructor mentions that we can utilize a preloader such as this - var percentageLoaded = root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal; loaderBar.scaleX = percentageLoaded; if (percentageLoaded > 1) { gotoAndPlay(3); } Frame 2 is a simple gotoAndPlay(1). I tried a similar construct, but it's not working. I'm trying - var percentageLoaded = 0; while (percentageLoaded < 1) { loaderBar.scaleX = percentageLoaded; percentageLoaded = root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal; } Not only does it not load, but it also throws the 15 second violation. What am I missing
VIEWS ON THIS POST

68

Posted on:

Wednesday 24th October 2012
View Replies!

[CS4] Why use a preloader? + how to..?

hi there, im currently designing my website, where amajority of the page is done via flash (infact the only bit thats not is hte header, where there is a google ad allowing me to enter the javascript code) in the bottom part which is all flash, im going to be running some rollover buttons, an mp3 player and obviously a small(ish) content area which will have the usual, (pictures/guestbook etc)....im concerned that it will take a while to load and wonder whether its worth using a preloader (the way i imagine a preloader to work is that it will load the website before displaying it allowing it to respond quickly) if this is the case...is it possible for me to have the background image with a loading bar above it as obviously it will look weird if i have a html top which loads straight away and theres no bottom to it because its loading... if anybody has a easy tutorial on how to do this it would be fantastic, i dont need anything amazing just something that loads and displays a bar that says its loading so the viewer does not get confused... please help!!!
VIEWS ON THIS POST

85

Posted on:

Wednesday 24th October 2012
View Replies!

preloader

hi i have created a movie that i want looped until my main site swf is loaded then i want my main site swf to be played im not sure how to go about it i no i can load the movie with the loadMovie("index.swf); at set time but i want it to be loaded in the background so the user does not have to wait is this possiable regards
VIEWS ON THIS POST

84

Posted on:

Wednesday 24th October 2012
View Replies!

preloader help.

Having received some amazing help from this site, I thought I might ask another question. Basically I want to design a preloader for a flash movie that counts down from 5 to 1. when the movie has loaded a fifth of itself the countdown goes down to the next number until its completely loaded then "0" appears. So I've put the numbers 5 - 0in a movieclip. Number 5 in frame 1, number 4 in frame 2 etc. The movieclip is in frame 1 of the overall flash movie. I thought something along the lines of: Code: bytesLoaded = _root.getBytesTotal(); percentLoaded = Math.round(100*bytesLoaded/bytesTotal); if (percentLoaded < 20) { this.gotoAndPlay(2) } and placed it in frame 1 of the preloader movieclip. But I don't think this is jumping to the next fame of the movieclip when a fifth of the total loaded frames is loaded. I think its just going to the next frame anyway. Sorry, I know this is probably fairly easy, but I need to get this figured ASAP and my brain's dying. Help! p.s. I'm using Actionscript 2.
VIEWS ON THIS POST

83

Posted on:

Wednesday 24th October 2012
View Replies!

Stringing together movieclips after preloader

, I've been struggling with this seemingly simple task. I have a fla that starts with a preloader that works properly. I then addChild a movie and it plays. I would like to have another movie load on a separate upper layer (so you can see the movie below it, like a background) with three different movies that can be advanced by a button. Here is my code so far. It loads the preloader up, then advances to drawing the graph. From here I've been adding a conditional checking to see if the movie is done playing -- playGraph.addEventListener(Event.ENTER_FRAME,check done,false,0,true); was the tip I was given -- but if I use an if statement, it loops over and over Here's the code. Hopefully it makes sense. PHP Code: stop(); this.addEventListener(Event.ENTER_FRAME,loading);//Eventlistener functionloading(e:Event):void{ \t\tvartotal:Number=this.stage.loaderInfo.bytesTotal;//TotalsizeofFLAfile \t\tvarloaded:Number=this.stage.loaderInfo.bytesLoaded;//Totalbytesloaded \t\t \t\tpreloader_logo.bar_mc.scaleX=(loaded/total)*100*\t1.5;//Growtheprogressbar--1.5 \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//addedtomakethebar \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//slightlywider \t\t \t\tpreloader_logo.loader_txt.text=Math.floor((loaded/total)*100)+"%";//Loadpercentagetxt \t\t \t\tif(total==loaded){//checkwhetherloadedornot; \t\t\t\t\t\t\t\t\t\t\t\t\t//removeeventlistenerandplayifso \t\t\t\tplay(); \t\t\t\tthis.removeEventListener(Event.ENTER_FRAME,loading); \t\t\t\tstop(); \t\t} \t\t \t\tvargraph=newGraph_mc(); \t\tgraph.x=280; \t\tgraph.y=180; \t\t \t\t \t\t \t\t\t\taddChild(graph); \t\t\t\t \t\t\t\t} \t\t \t\t} } From the addChild I assume that I want to do 'if graph is done playing, start with the first part of the movie', but it gets caught in a loop if I trace 'done'. I'm at a loss.
VIEWS ON THIS POST

95

Posted on:

Thursday 25th October 2012
View Replies!

noob preloader issues...

i am a complete noob to flash and as3 - couple of days ago i didnt even know actionscript existed. a client wanted me to make a web presentation of an apartment building which i designed - something for the potential buyers to browse. ok, so i opened flash for the first time and did this in flash using as3 because that was the default option when i opened flash and i didnt know any better. so my flash file is in as3. now, the very first page that you see - the one where you choose your screen resolution - is pure html and it turns to the two distinct htmls in which the flash movies are embedded. for each resolution version, i have made a separate flash file (because i didnt like any of the results i got when tried to simply scale down from 1024 to 800). so i have the htmls and the swfs that they call for. thats all. i have tried and browsed and tutorialled myself silly for a simple bar preloader (no dynamic text, percents, fancy animations, just a simple bar stretching out to full length). i have found more than enough even on these forums, but none of them does its job. im sure im missing something super simple. all of the pre-loaders i have tried are displayed only AFTER the whole movie is loaded (sure none of them stretches the bar) - some of them just sit there and dont move on, (even tho i have triple checked that it clearly says after loaded bytes equal complete bytes gotoandplay frame such and such). i will only have: - a rectangle with no fill to indicate the full-size of the loader bar - the loader bar stretching from left to right - a static text saying the presentation is loading can somebody give me a couple of idiot-proof tips of freaking what code to use, what to put on the stage, how to publish to html, etc. etc. so that the pre-loader shows WHILE the movie is loading yours frustrated, alnoth
VIEWS ON THIS POST

97

Posted on:

Thursday 25th October 2012
View Replies!

preloader screen blank until loaded

I have used this method before to make a preloader. But this time for some reason the screen is blank until the movie is finished loading. The bandwidth profiler says I am on frame 0. PHP Code: functioneventLoaderFrame(e:Event):void{\t\tif(boolLoaded==false){\t\t\t\tvartotal:Number=this.stage.loaderInfo.bytesTotal;\t\t\t\tvarloaded:Number=this.stage.loaderInfo.bytesLoaded;\t\t\t\t\t\t\t\tmc_preloader.txtLoader.text=Math.floor((loaded/total)*100)+"\t%";\t\t\t\tif(total==loaded){\t\t\t\t\t\tboolLoaded=true;\t\t\t\t\t\tthis.removeEventListener(Event.ENTER_FRAME,eventLoaderFrame);\t\t\t\t\t\tthis.addEventListener(Event.ENTER_FRAME,enterFrameHandler);\t\t\t\t}\t\t}\t\tmoveMc(mc_cloud);\t\tmoveMc(mc_cloud2);\t\tmoveMc(mc_cloud3);\t\tmoveMc(mc_cloud4);\t\tmoveMc(mc_cloud5);\t\tmoveMc(mc_cloud6);} I have been comparing this to another project (that uses the same code)and it loads fine in Simulate Download and BWProfiler says frame 1 while loading. There are no differences in the Public Settings, or any other settings I can see... what is up
VIEWS ON THIS POST

89

Posted on:

Thursday 25th October 2012
View Replies!

Getting a preloader to work.

Link to source files: http://www.johncliffordtaylor.com/flaSourceFiles.rar every one I'm trying to get a preload movie clip (loaderMovieClip_mc) to show up when an image is being pulled from the xml data bank and then turn the visibility to false when the image is done loading. I have no idea what I'm doing wrong any bump in the right direction would be very cool. Error message: TypeError: Error #1009: Cannot access a property or method of a null object reference. at flashIndex6_fla::MainTimeline/frame1() I think there is a conflict happening between the unloading of the imageLoader:Loader class: PHP Code: functioncheckerF(event:TimerEvent):void{\t\tif(imageLoader!=null){\t\t\t\tpictureContainer_mc.removeChild(imageLoader);\t\t\t\timageLoader.unload();\t\t} and then the preloader is calling it to try and recive the incoming XML data to display on screen: PHP Code: imageLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,loadProgress);functionloadProgress(event:ProgressEvent):void{\t\t\tvardataLoaded:Number=event.target.bytesLoaded;\t\tvartotal:Number=event.target.bytesTotal;\t\tvarpercent_loaded:Number=(dataLoaded/total)*100;\t\tif(percent_loaded
VIEWS ON THIS POST

76

Posted on:

Thursday 25th October 2012
View Replies!

text preloader

how to make text acting as a preloader so that its color changes as preloader percentage. i dont mean how to apply the math, i mean how to mask it or whatever action to achieve that effect like for example imagine the red is constantly growing to the right letter by letter (actually pixel by pixel: SOME TEXT
VIEWS ON THIS POST

69

Posted on:

Thursday 25th October 2012
View Replies!

Problem with preloader

all, help me solve the problem with preloader: code preloader: Code: import flash.display.Loader; import flash.display.LoaderInfo; var myLoader:Loader = new Loader(); var myRequest:URLRequest = new URLRequest("HipHop.swf"); import flash.net.URLRequest; myLoader.load(myRequest); myLoader.contentLoaderInfo.addEventListener(Event.OPEN,showPreloader); myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,showProgress); myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,showLoadResult); import flash.events.Event; import flash.events.ProgressEvent; function showPreloader(evt:Event):void { addChild(txtBox); addChild(anim); } function showProgress(evt:ProgressEvent):void { var loaded:Number = evt.bytesLoaded var total:Number = evt.bytesTotal var percent:Number = Math.ceil((loaded/total)*100); txtBox.text = percent+" %"; anim.play(); } function showLoadResult(evt:Event):void { removeChild(txtBox); removeChild(anim); addChild(myLoader); } in i loading my HipHop.swf, i see this error: TypeError: Error #1009: Cannot access a property or method of a null object reference. preloader and Premit debug show me line with error: init (); and in function int(), line with stage.addEventListener (Event.RESIZE, updateSize); Code: package { import flash.utils.*; import flash.display.BlendMode; import flash.display.Sprite; import flash.display.SimpleButton; import flash.display.MovieClip; import flash.events.MouseEvent; import flash.events.Event; import flash.events.IOErrorEvent; import flash.events.TimerEvent; import flash.events.*; import fl.transitions.Tween; import fl.transitions.TweenEvent; import fl.transitions.easing.*; import flash.events.ProgressEvent; import flash.display.Loader; import flash.display.*; import flash.net.URLRequest; import flash.net.URLLoader; import flash.external.ExternalInterface; public class HipHop extends Sprite { public var MenuObjects:Array; public var MenuLinks:Array; public var MenuItems:Array; public var MenuLabels:Array; public var MainLoader:Loader; public var Main:MovieClip; public var server:String; public var PNum:int; var uld:URLLoader; var PNumbers:Array; var ImageLoader:Loader; var TMR:Timer; var CurMenu:String; var pageIMGTween:Tween; var Screen:Object; public function HipHop ():void { var i:int; MenuObjects=new Array(); MenuItems=new Array(Philosophy,Catalogo,Advertising,Locator,Contatti,Downloads,Hiphopize); for (i=0; i
VIEWS ON THIS POST

75

Posted on:

Thursday 25th October 2012
View Replies!

Image sequence as preloader

hey! I'm making my portfolio site. I would like to make a preloader in after effects(100 frames). Since I don't know much about actionscript I was wondering if it is possible to load a new frame each percent It should load my main.swf and then open it. So i don't want it jump to frame 2. Might there be any other ways to do achieve this, or is it the way to go From what i understand this should not be much of a code...
VIEWS ON THIS POST

75

Posted on:

Thursday 25th October 2012
View Replies!