Ultrashock Forums > Flash > Flash Professional
Site Disappearing

You are currently viewing our website as a guest which gives you limited access to forums, files and other resources.

Click here to join now for free, and start interacting with our members, download files and much more!

Click here if you are looking for our Flash files and other professional assets.
 
Post Reply | View first unread | Rate Thread Search this Thread | Thread Tools | Display Modes

#1
Bookmark and Share!
Site Disappearing
Old 2007-08-16

I have a site that works off full screen flash.

I am having a problem where after the preloader and the site animates in the site disappears the first time, but when you hit "refresh" it animates the site in, then it stays.

Also the site seems rather choppy the first time, then after going through the pages and refreshing they play smooth. I am starting to think my preloader isnt "preloading"

Below is my full screen code.

ActionScript Code:
  1. Stage.scaleMode = "noscale";
  2. Stage.align = "tl";
  3. Stage.addListener({onResize:reposition});
  4.  
  5. function reposition() {
  6.         var bg = _root.bg_mc;
  7.         var tour = _root.tour_mc;
  8.        
  9.         var nPos;
  10.        
  11.         nPos = getNewPosition(bg);
  12.         bg._x = nPos.x;
  13.         bg._y = nPos.y;
  14.        
  15.         nPos = getNewPosition(tour);
  16.         tour._x = nPos.x;
  17.         tour._y = nPos.y;
  18.            
  19. };
  20.  
  21. function getNewPosition(mc) {
  22.         var newX = Math.floor((Stage.width - mc._width) / 2);
  23.         var newY = Math.floor((Stage.height - mc._height) / 2);
  24.         return {x:newX, y:newY};
  25. };
  26.  
  27. reposition();
  28.  
  29. stop();

Now my preload code.
ActionScript Code:
  1. onClipEvent (load) {
  2.     if (_root.getBytesTotal() == _root.getBytesLoaded()) {
  3.         quickPlay = true;
  4.     } else {
  5.         preLoad = (_root.getBytesTotal() * 0.95)//percent to preload
  6.     }
  7.     _root.stop();
  8. }
  9.  
  10. onClipEvent (enterFrame) {
  11.     gotoAndStop(loadedIndicatorFrame());
  12.     if (quickPlay == true) {  //quickly play the anim
  13.         if (_currentframe == _totalframes) {
  14.             _root.gotoAndPlay("project");
  15.  
  16.         }
  17.     } else {  //wait for the preload
  18.         if (_root.getBytesLoaded() >= preLoad) {
  19.             _root.gotoAndPlay("project");
  20.         }
  21.     }
  22. }

This is the code inside the preloader.
ActionScript Code:
  1. lastFrame = 1;
  2.  
  3. function loadedIndicatorFrame() {
  4.     var newFrame = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 65) + 2;
  5.     if (newFrame - lastFrame > 4) {  //too far
  6.         lastFrame += 4;
  7.         loadedText = int(_root.getBytesTotal() / 1024 * (lastFrame - 2) / 65) + "kb of " + int(_root.getBytesTotal() / 1024) + "kb";
  8.     } else if (newFrame - lastFrame > 0) {  //normal move
  9.         lastFrame++;
  10.         loadedText = int(_root.getBytesLoaded() / 1024) + "kb of " + int(_root.getBytesTotal() / 1024) + "kb";
  11.     } else {  //update the text only
  12.         loadedText = int(_root.getBytesLoaded() / 1024) + "kb of " + int(_root.getBytesTotal() / 1024) + "kb";
  13.     }
  14.     return lastFrame;
  15. }

I have used these three sets of code before trouble free, so I am lost why this is a problem now.

Any help would be great.

-- Nate
..:: www.ne-media.com ::..
postbit arrow 4 comments | 204 views postbit arrow Reply: with Quote   
Registered User
nate51 is offline
seperator
Posts: 55
2005-06-27
nate51 lives in Canada
seperator

Ultrashock Member Comments:
nate51 nate51 is offline nate51 lives in Canada 2007-08-19 #2 Old  
Has anyone had anything similar to this problem? The site is not loading external swf files, it's all one file but the site vanishes after loading.
Reply With Quote  
geo_speed geo_speed is offline geo_speed lives in India 2007-08-20 #3 Old  
Can we see your problem???
Reply With Quote  
nate51 nate51 is offline nate51 lives in Canada 2007-08-20 #4 Old  
Last edited by nate51 : 2007-08-20 at 14:23.
Works now.
Reply With Quote  
aldoreyes aldoreyes is offline 2007-08-20 #5 Old  
Naahh, its working for me didnt have any error
Reply With Quote  
Thread Tools
Display Modes Rate This Thread
Rate This Thread: