SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Any reason my flash background will not work in IE?

    I am using this code for fullscreen flash with horizontally centered content. The code I am using is working pretty well in Firefox (every once in a blue moon the background jpg won't load in firefox3) but my biggest issue is it pretty much never loads in IE (the image is just a standard jpg). Does anyone see any problems with how I am handling this that it would be having issues in IE? Please let me know as this is pretty much driving me crazy!

    Here is a sample of my code:

    Code:
    stop();
    
    Stage.scaleMode = "noscale";
    Stage.align = "TL";
    
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    
    //Center movieClip reusable function
    function centerMC(mc:MovieClip):Void {
    	
    	mc._x = Math.floor((Stage.width - mc._width) / 2);
    	//mc._y = Math.floor((Stage.height - mc._height) / 2);
    	
    }
    
    //Fade in or out reusable function
    function fadeMc(mc:MovieClip, newAlpha:Number, duration:Number):Void {
    	
    	var mcAlpha:Number = mc._alpha;
    	var fade:Tween = new Tween(mc, "_alpha", Regular.easeOut, mcAlpha, newAlpha, duration, false);
    	
    }
    
    //Reposition elements
    function reposition():Void {
    	
    	centerMC(mcholder);
    	bkgScale();
    	
    };
    
    Stage.addListener({onResize:reposition});
    
    //Scale Background
    function bkgScale():Void {
    	
    	// This is the proportion (width/height) of the image
    	var imageScale:Number = bkgHolder._width/bkgHolder._height;
    	
    	// This is the proportion (width/height) of the stage
    	var stageScale:Number = Stage.width/Stage.height;
    	
    	// If the stage scale is bigger than the image scale the images width resizes to the stage
    	// width and the image height takes the stage proportion
    	if (stageScale>=imageScale) {
    		
    		bkgHolder._width = Stage.width;
    		bkgHolder._height = Stage.width/imageScale;
    		
    	// If the stage scale is smaller than the image scale the images height resizes to the stage
    	// height and the image width takes the stage proportion
    	} else {
    		
    		bkgHolder._height = Stage.height;
    		bkgHolder._width = Stage.height*imageScale;
    	}
    	
    }
    
    /////////////Loader//////////////////////
    var loaderListener:Object = new Object();
    //When loading starts turn the loaded clip alpha to 0
    loaderListener.onLoadStart = function(mc:MovieClip):Void {
    	
    	mc._alpha = 0;
    	
    };
    //When the first frame of the loaded clip have been executed
    loaderListener.onLoadInit = function(mc:MovieClip):Void {
    	//if it is the background
    	//scale background
    	//and load the external mc with a 1000 miliseconds delay
    	// so the appearing of the elements seem more smooth
    	if (mc == bkgHolder) {
    		
    		bkgScale();
    		
    		setTimeout(loadMc, 1300);
    		
    	} 
    	
    	//if it is the external mc
    	//center it
    	else if (mc == mcholder) {
    		
    		centerMC(mc);
    	}
    	
    	//Tween the loaded alpha to 100
    	fadeMc(mc, 100, 28);
    	
    };
    
    var loader:MovieClipLoader = new MovieClipLoader();
    loader.addListener(loaderListener);
    //Load external MC
    function loadMc():Void {
    	
    	loader.loadClip("sgcore.swf", mcholder);
    	
    }
    //Load background image
    function loadBKG():Void {
    	
    	loader.loadClip("background.jpg", bkgHolder);
    	
    }
    //Start Loading
    loadBKG();

  2. #2
    SitePoint Guru [Paul Ferrie]'s Avatar
    Join Date
    Oct 2007
    Location
    Glasgow, Scotland, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can you post a link to the page?
    .:To me AS is like LEGO, Only for the big Kids :.
    - Site - Blog - Glasgow Flasher
    bringmadeleinehome.com

  3. #3
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sure - here is a rough example of my code - nothing much in the way of content, but same problem as stated above.

  4. #4
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    geez - I have to have made 10 posts in order to post the link? That's lame... I'll PM it to you.

  5. #5
    SitePoint Guru [Paul Ferrie]'s Avatar
    Join Date
    Oct 2007
    Location
    Glasgow, Scotland, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I see no reason why the bg will not load in IE.
    .:To me AS is like LEGO, Only for the big Kids :.
    - Site - Blog - Glasgow Flasher
    bringmadeleinehome.com

  6. #6
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    did the background show for you in IE?

  7. #7
    SitePoint Enthusiast
    Join Date
    Nov 2008
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well besides the fact that it is a Microsoft product, nothing comes to mind. If others are able to view it in Internet Explorer then maybe there is something screwy with the install on your computer, maybe re-install it?
    --------------------

    Web Hosting Reviews, News and Articles
    www.kubus.net

  8. #8
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it has been consistent across the mac's (running vmware fusion/windows xp) and 2 pc's I have here at home...

  9. #9
    SitePoint Guru [Paul Ferrie]'s Avatar
    Join Date
    Oct 2007
    Location
    Glasgow, Scotland, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by arteye View Post
    did the background show for you in IE?
    No.
    .:To me AS is like LEGO, Only for the big Kids :.
    - Site - Blog - Glasgow Flasher
    bringmadeleinehome.com

  10. #10
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    any changes you think I should make to the code to maybe try a different method?

  11. #11
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was able to correct this issue with upgrading from swfobject 1.5 to the latest 2.1 version. Thanks for everyone's help though!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •