Page 2 of 2

Re: A Preloader to load the SWF

Posted: Mon Feb 08, 2010 11:37 pm
by erik leeman
Didn't you get an error message like "URL not found"?

You have:

Code: Select all

var url:String = "http://www.photosynergy.net/hannesbecker/livingroom.swf";
Better make that a relative path like:

Code: Select all

var url:String = "../hannesbecker/livingroom.swf";
For testing on your own computer just put your preloader .swf and 'livingroom.swf' in a directory named 'hannesbecker'.
If your preloader .swf can't find the Flash file it is supposed to preload, it can't do much other than to show an empty screen.

This bit:

Code: Select all

function loop(e:ProgressEvent):void {
var perc:Number = e.bytesLoaded / e.bytesTotal;
percent.text = Math.ceil(perc*100).toString();
LoadIndicator.width = perc * 800; // my loadindicator is 400 pixels wide at 100%
}
can't do much unless you actually make an object named 'LoadIndicator'

Have a look at this website to see a tutorial about how a 'normal' preloader is made in ActionScript3:
http://www.gotoandlearn.com
I think it's tutorial number 84, named 'Preloading in ActionScript 3'
Do note that for Pano2VR Flash panos a 'normal' preloader does not work, you MUST follow Thomas' instructions to the letter!

Erik

Re: A Preloader to load the SWF

Posted: Tue Feb 09, 2010 12:06 am
by bernielove1
Man this is getting confusing. I changed it to a relative path with no change. I have seen that tutorial and it was pretty simple. At least it seemed. The object that needs the name "LoadIndicator", is that the progress bar? Do I need to rename it that?

Re: A Preloader to load the SWF

Posted: Tue Feb 09, 2010 1:00 am
by bernielove1
Why would a normal preloader work just fine in the Flash preview but not work online?

Re: A Preloader to load the SWF

Posted: Tue Feb 09, 2010 1:06 am
by erik leeman
It doesn't matter what name you choose for your progress bar, it can be 'ProgressBar' or 'LoadIndicator' or whatever you want, as long as you use the same name for it everywhere in your Flash project.
Why would a normal preloader work just fine in the Flash preview but not work online?
Don't know, could be anything, really can't tell from here.

Erik

Re: A Preloader to load the SWF

Posted: Tue Feb 09, 2010 1:24 am
by bernielove1
OK so I changes the "loader"s to "MyPreloader" but no I get an error that says "access to undefined property loader." vr = MovieClip(loader.content); // cast 'DisplayObject' to 'MovieClip'

Re: A Preloader to load the SWF

Posted: Tue Feb 09, 2010 1:42 am
by bernielove1
mmm this isn't going well. Is there a chance I can use one of these (http://www.easypano.com/Virtual-tour-so ... 4_375.html) and if so how can I change the code to pull up my SWF?

Re: A Preloader to load the SWF

Posted: Tue Feb 09, 2010 8:51 am
by erik leeman
Please read this carefully:

IF you only want a progress bar for your Pano2VR panoramas,
AND/OR
IF you are clueless about ActionScript3 programming,
THEN
STOP wasting your time!

Again: look at this tutorial video on how to make a progress bar using Pano2VR's skin editor
http://gardengnomesoftware.com/tutorial.php?movid=06_3
This will give you what you want, much easier and better than any other way!

END

Erik

Re: A Preloader to load the SWF

Posted: Tue Feb 09, 2010 10:17 am
by smooth
It would appear he wants "Flash Animation" as the loader.

Regards, Smooth 8)

Re: A Preloader to load the SWF

Posted: Tue Feb 09, 2010 10:24 pm
by bernielove1
I guess "preloader" may be the wrong word. I am hoping to add a progress bar to show the loading of the initial SWF file which is 4mb right now. My next step I think will be to try and reduce that size down to at least 500kb.

Re: A Preloader to load the SWF

Posted: Wed Feb 10, 2010 8:01 am
by smooth
The link to this tour already shows a "Pre-loader Progress Bar"
You just won't see it, if the tour has already been loaded to cache or if you are testing it locally. Go to the address and click F5 on your keyboard to force a reload.

Regards, Smooth 8)

Re: A Preloader to load the SWF

Posted: Tue Aug 17, 2010 11:00 pm
by cwt1971
I believe that Bernie is looking for a way to solve the preloading problem. And so am I. I get this in the trace when I start:

uhh... init stage
root child!
uhh... init stage
uhh... init stage
uhh... init stage
uhh... init stage
root child!
uhh... init stage
uhh... init stage
uhh... init stage
uhh... init stage
uhh... init stage
uhh... init stage
uhh... init stage


I need hel[p on a way to prevent the null reference error too...

Thanks,
Chris
bernielove1 wrote:I created a web page that contained my swf file. When the page is loading it takes about 15 seconds for the SWF file to start loading. I wanted to add a separate preloader to show the progress. It works but when it loades it only shows my navigation buttons and hotspots. The rest is white. Here is what it looks like (http://www.photosynergy.net/hannesbecke ... ltour1.htm). Can anyone help me with this?