dcsimg
A Flash Developer Resource Site

Results 1 to 18 of 18

Thread: [F8] Can't get ext .swf file to load in main.swf

  1. #1
    Member
    Join Date
    Apr 2006
    Location
    Florence, SC
    Posts
    73

    [F8] Can't get ext .swf file to load in main.swf

    I have a main.swf that is supposed to load and ext .swf depending on wait time of day and day it is. If i pulish the main.swf in flash 8....it will load the according ext .swf into the main.swf..no prob... When i take the published main.swf and put it into a blank .html doc, then publish the .html......the main.swf shows up, but the ext .swf files don't load! All files are in the same folder. Any ideas, i have included the code....mainly concentrating on the day "thursday".

    Main.swf (timeDateLoadMovieSwitch.swf)
    ext .swf files (edpalmer.swf, mm.swf, etc)

    Code:

    Code:
    _root.onLoad = function() {
    	var myMonths:Array = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
    	var dayOfWeek_array:Array = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
    	var today_date:Date = new Date();
    	var day_str:String = dayOfWeek_array[today_date.getDay()];
    	var myHour = today_date.getHours();
    	var myMinute = today_date.getMinutes();
    	var mySeconds = today_date.getSeconds();
    	var time = myHour+" "+myMinute+" "+mySeconds;
    	trace("onload="+day_str);
    	switch (day_str) {
    	case "Tuesday" :
    		if (time>="19 00 0") {
    			holder.loadMovie("tombrockway.swf");
    		} else if (time>="15 00 0") {
    			holder.loadMovie("edpalmer.swf");
    		} else if (time>="10 00 0") {
    			holder.loadMovie("chasematthews.swf");
    		} else if (time>="5 00 0") {
    			holder.loadMovie("mm.swf");
    		}
    		break;
    	case "Wednesday" :
    		if (time>="19 00 0") {
    			holder.loadMovie("tombrockway.swf");
    		} else if (time>="15 00 0") {
    			holder.loadMovie("edpalmer.swf");
    		} else if (time>="10 00 0") {
    			holder.loadMovie("chasematthews.swf");
    		} else if (time>="5 00 0") {
    			holder.loadMovie("mm.swf");
    		} else if (time>="1 00 0") {
    			holder.loadMovie("some.swf");
    		}
    		break;	
    	case "Thursday" :
    		if (time>="19 00 0") {
    			holder.loadMovie("tombrockway.swf");
    		} else if (time>="15 00 0") {
    			holder.loadMovie("edpalmer.swf");
    		} else if (time>="10 00 0") {
    			holder.loadMovie("chasematthews.swf");
    		} else if (time>="5 00 0") {
    			holder.loadMovie("mm.swf");
    		} else if (time>="1 00 0") {
    			holder.loadMovie("some.swf");
    		}
    		break;
    	}
    	timeInterval = setInterval(TimeDateCheck, 1000);
    }
    TimeDateCheck = function () {
    	var myMonths:Array = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
    	var dayOfWeek_array:Array = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
    	var today_date:Date = new Date();
    	var day_str:String = dayOfWeek_array[today_date.getDay()];
    	var myHour = today_date.getHours();
    	var myMinute = today_date.getMinutes();
    	var mySeconds = today_date.getSeconds();
    	var time = myHour+" "+myMinute+" "+mySeconds;
    	//trace("Today is "+day_str+" "+"Time of day= "+time);
    	//handle day loading times
    	switch (day_str) {
    	case "Monday" :
    		if (time == "05 00 0") {
    			holder.loadMovie("someMovie.swf");
    		} else if (time == "10 00 0") {
    			holder.loadMovie("someMovie.swf");
    		} else if (time == "15 00 0") {
    			holder.loadMovie("someMovie.swf");
    		} else if (time == "19 00 0") {
    			holder.loadMovie("someMovie.swf");
    		}
    		break;
    	case "Tuesday" :
    		trace(day_str);
    		trace(time);
    		if (time == "19 00 0") {
    			holder.loadMovie("tombrockway.swf");
    		} else if (time == "15 00 0") {
    			holder.loadMovie("edpalmer.swf");
    		} else if (time == "10 00 0") {
    			trace("time reached");
    			//clearInterval(timeInterval);
    			holder.loadMovie("chasematthews.swf");
    		} else if (time == "05 00 0") {
    			holder.loadMovie("mm.swf");
    		} else if (time == "00 00 0") {
    			holder.loadMovie("some.swf");
    		}
    		break;
    	case "Wednesday" :
    		trace(day_str);
    		trace(time);
    		if (time == "19 00 0") {
    			trace("time reached");
    			holder.loadMovie("tombrockway.swf");
    		} else if (time == "15 00 0") {
    			holder.loadMovie("edpalmer.swf");
    		} else if (time == "10 00 0") {
    			holder.loadMovie("chasematthews.swf");
    		} else if (time == "05 00 0") {
    			holder.loadMovie("mm.swf");
    		} else if (time == "01 00 0") {
    			holder.loadMovie("some.swf");
    		}
    		break;
    	case "Thursday" :
    		trace(time);
    		if (time == "19 00 0") {
    			trace("time reached");
    			//clearInterval(timeInterval);
    			holder.loadMovie("tombrockway.swf");
    		} else if (time == "15 00 0") {
    			holder.loadMovie("edpalmer.swf");
    		} else if (time == "10 00 0") {
    			holder.loadMovie("chasematthews.swf");
    		} else if (time == "5 00 0") {
    			trace("time reached");
    			//clearInterval(timeInterval);
    			holder.loadMovie("mm.swf");
    		}
    		break;
    	case "Friday" :
    		trace(day_str);
    		trace(time);
    		if (time == "17 13 0") {
    			holder.loadMovie("someMovie.swf");
    		} else if (time == "17 14 0") {
    			holder.loadMovie("someOther.swf");
    		} else if (time == "18 00 0") {
    			holder.loadMovie("someMovie.swf");
    		} else if (time == "20 00 0") {
    			holder.loadMovie("someMovie.swf");
    		}
    		break;
    	case "Saturday" :
    		trace(day_str);
    		if (time == "06 00 0") {
    			holder.loadMovie("someMovie.swf");
    		} else if (time == "09 00 0") {
    			holder.loadMovie("someMovie.swf");
    		} else if (time == "14 00 0") {
    			holder.loadMovie("someMovie.swf");
    		} else if (time == "19 00 0") {
    			holder.loadMovie("someMovie.swf");
    		}
    		break;
    	case "Sunday" :
    		trace(day_str);
    		if (time == "06 00 0") {
    			holder.loadMovie("someMovie.swf");
    		} else if (time == "10 00 0") {
    			holder.loadMovie("someMovie.swf");
    		} else if (time == "12 00 0") {
    			holder.loadMovie("someMovie.swf");
    		} else if (time == "18 00 0") {
    			holder.loadMovie("someMovie.swf");
    		} else if (time == "23 00 0") {
    			holder.loadMovie("someMovie.swf");
    		}
    		break;
    	}
    };

    Thanks...
    Sorry....I can't spell to save my life...Enjoy

  2. #2
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    can you provide examples.. both on-line and off?

    liek the .fla's to look at? are you exeriencing these problems in different browsers?

    I dont really understand your :
    When i take the published main.swf and put it into a blank .html doc, then publish the .html......the main.swf shows up, but the ext .swf files don't load!
    comment..

  3. #3
    Member
    Join Date
    Apr 2006
    Location
    Florence, SC
    Posts
    73
    I have attached a zip file of all files. Its the main(timeDateLoadMovieSwitch.swf) file and all the external .swfs, with the .html. What i want to happen is: Have the timeDateLoadMovieSwitch.swf work right when it is in the untitled.html. If you run the timeDateLoadMovieSwitch.swf in the standalone flash player it will work.

    Your computer must have the local time set to: THURSDAY for it to work. Thanks
    Attached Files Attached Files
    Sorry....I can't spell to save my life...Enjoy

  4. #4
    Member
    Join Date
    Apr 2006
    Location
    Florence, SC
    Posts
    73
    No Luck, huh?
    Sorry....I can't spell to save my life...Enjoy

  5. #5
    Member
    Join Date
    Apr 2006
    Location
    Florence, SC
    Posts
    73
    Sorry....I can't spell to save my life...Enjoy

  6. #6
    Member
    Join Date
    Apr 2006
    Location
    Florence, SC
    Posts
    73
    The prob is:

    The main.swf will load external .swf's while its in a .html page. The main.swf laod external .swf files into the main.swf just fine, when in Flash's Standalone player. Anybody???/
    Sorry....I can't spell to save my life...Enjoy

  7. #7
    Banned NTD's Avatar
    Join Date
    Feb 2004
    Posts
    3,438
    Removing any helpful previous posts I mistakenly contributed to these forums.

    See ya FK'ers
    Last edited by NTD; 10-19-2006 at 06:07 AM.

  8. #8
    Member
    Join Date
    Apr 2006
    Location
    Florence, SC
    Posts
    73
    Nope removed it and it doesn't work (Removed: _root.onLoad = ). Any other idea's? Suck have this code finally work then.....I put it in a webpage, and no dice
    Sorry....I can't spell to save my life...Enjoy

  9. #9
    Member
    Join Date
    Apr 2006
    Location
    Florence, SC
    Posts
    73
    Still no ideas............????? Works with firefox i think.
    Sorry....I can't spell to save my life...Enjoy

  10. #10
    Member
    Join Date
    Apr 2006
    Location
    Florence, SC
    Posts
    73
    Someone!!!! Please Help....i can't find the error anywhere, got to be so simple...atleast let me know if my code is right, Thanks
    Sorry....I can't spell to save my life...Enjoy

  11. #11
    Banned NTD's Avatar
    Join Date
    Feb 2004
    Posts
    3,438
    Removing any helpful previous posts I mistakenly contributed to these forums.

    See ya FK'ers
    Last edited by NTD; 10-19-2006 at 06:07 AM.

  12. #12
    Member
    Join Date
    Apr 2006
    Location
    Florence, SC
    Posts
    73
    Thanks you very much again....Yeah, i saw the duplication. I was going to take care of that myself. It does work, the prob is just in the web browser...works fine in the stand alone player. Thanks again......Don't think anyone else has any ideas, so i will just wait
    Sorry....I can't spell to save my life...Enjoy

  13. #13
    Member
    Join Date
    Apr 2006
    Location
    Florence, SC
    Posts
    73
    No idea;s ;(
    Sorry....I can't spell to save my life...Enjoy

  14. #14
    Member
    Join Date
    Apr 2006
    Location
    Florence, SC
    Posts
    73
    Hey ....just check to see if you if you had any luck this weekend.
    Sorry....I can't spell to save my life...Enjoy

  15. #15
    Member
    Join Date
    Apr 2006
    Location
    Florence, SC
    Posts
    73
    Will try in it a bit....THANK YOU soooooo much for your time. And you site is pretty dang cool too!
    Sorry....I can't spell to save my life...Enjoy

  16. #16
    Member
    Join Date
    Apr 2006
    Location
    Florence, SC
    Posts
    73
    Hmmm....well, i think i know why there might have been so much.....bc unless it is the EXACT time in the statments....nothing shows up, think thats why you had the set of => statments in there....GOOD NEWS is....it does "work" in an html page...as long as it is the EXACT time stated....and it will hold, and stay once its loaded. I think we needed the onload to check the time when the page is loaded. But its working.

    Just need it to be able to load at anytime (check the <=, i think that is what you had) then load the right .swf

    THanks again, atleast it loads in a html....and im not crazy...
    Sorry....I can't spell to save my life...Enjoy

  17. #17
    Senior Member
    Join Date
    Oct 2004
    Posts
    2,049
    Try this fla out - you can downlaod it at www.wattsupnow.com/test/TimeDateLoad_wun.zip

    It will load the required swf and stay loaded until next time.

  18. #18
    Member
    Join Date
    Apr 2006
    Location
    Florence, SC
    Posts
    73
    Hey, I apprecatie you working on this. But it still doesn't seem to load, unless it is the EXACT time set...i can Crtl-Enter...sit and what the time count up to the EXACT time...the poof...if loads and staty loaded, untill i close the window...the if i crt-enter again (with it being the same time, just a few sec's off) it will not load agin. Strange.

    In the emmbedd html file. It does the same thing....i can sit and wait for the time to change exact...and boom...and changes....but if i refreash the page....doesn't load....

    I tryed this on 2 diffrent machines...still no dice...any idea's? I see what you added, not sure exactly what its doing.
    Sorry....I can't spell to save my life...Enjoy

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center