# Weird preloading pb

**URL:** <https://forum.kirupa.com/t/weird-preloading-pb/120345>\
**Category:** Uncategorized\
**Created:** [August 23, 2004, 2:54pm UTC](https://forum.kirupa.com/t/weird-preloading-pb/120345 "2004-08-23T14:54:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uli](https://avatars.discourse-cdn.com/v4/letter/u/ccd318/32.png) [@Uli](https://forum.kirupa.com/u/Uli)\
**Post date:** [August 23, 2004, 2:54pm UTC](https://forum.kirupa.com/t/weird-preloading-pb/120345/1 "2004-08-23T14:54:18Z")

</div>

Hello,

I have 2 scenes, 1 preloading and 1 main scene. When i remove the preloading, the main scene plays just fine but with the preloading, it bugs: the panorama won’t move…

I have a basic preloading:

```php

bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadbar._width = getPercent*187;
this.loadtext = Math.round(getPercent*100)+"% Please WAit...";
if (bytes_loaded == bytes_total) {
	this.gotoAndPlay(3);
//the scene 3 gotoAndStops the 1st frame of my main scene, the frame 2 loops that piece of code...
}

```

In my main scene now, i have an infinite loop for a panorama that interacts with a MC (speed and position). It works fine alone…

```php

_root.onLoad = function() {
	//Bunch of variables
	xcenter = 400;
	_global.speed = 1/30;
};
_root.onEnterFrame = function() {
	speedratio = _root.scaled;
	if(speedratio > 80){speedratio = 80};
	_global.speed = 1/((100-speedratio)*0.8);
	
	//Move panorama
	var distance = _root.Para._x-xcenter;
	_root.Panorama._x -= (distance*_global.speed);
	if (_root.Panorama._x>0) {
		_root.Panorama._x = -3019;
	}
	if (_root.Panorama._x<-3019) {
		_root.Panorama._x = 0;
	}
};

```

Can anyone tell me what’s wrong??  
TiA 🙂
