A Preloader to load the SWF

Using Pano2VR/Object2VR SWF files with your own Flash projects
erik leeman
Posts: 470
Joined: Sat Sep 09, 2006 10:51 am
Contact:

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
bernielove1
Posts: 12
Joined: Fri Feb 05, 2010 9:12 pm

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?
bernielove1
Posts: 12
Joined: Fri Feb 05, 2010 9:12 pm

Why would a normal preloader work just fine in the Flash preview but not work online?
erik leeman
Posts: 470
Joined: Sat Sep 09, 2006 10:51 am
Contact:

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
bernielove1
Posts: 12
Joined: Fri Feb 05, 2010 9:12 pm

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'
bernielove1
Posts: 12
Joined: Fri Feb 05, 2010 9:12 pm

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?
erik leeman
Posts: 470
Joined: Sat Sep 09, 2006 10:51 am
Contact:

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
smooth
Posts: 1493
Joined: Sat Sep 09, 2006 7:30 pm

It would appear he wants "Flash Animation" as the loader.

Regards, Smooth 8)
Image
bernielove1
Posts: 12
Joined: Fri Feb 05, 2010 9:12 pm

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.
smooth
Posts: 1493
Joined: Sat Sep 09, 2006 7:30 pm

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)
Image
cwt1971
Posts: 1
Joined: Fri Jul 30, 2010 3:33 pm

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?
Post Reply