dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: movie clips go Mental!

  1. #1
    Member
    Join Date
    May 2008
    Location
    Ireland
    Posts
    77

    movie clips go Mental!

    Hi when I test my movie localy everything is fine, but once on server it they start to go a bit crazy. Is this because my main file is not set-up correctly. here is the code in the main timeline.

    I have a movie clip with buttons for a golf course.
    Then a menu bar which loads SWFs into an ImageLoader.


    Code:
    stop();
    import flash.events.MouseEvent;
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    
    container_mc.addChild(course_mc);
    course_mc.x = 0;
    course_mc.y = 0;
    container_mc.alpha = 0;
    container_mc.addEventListener(Event.ENTER_FRAME, animate); // every frame
    
    function animate (event:Event):void
    {
    	container_mc.alpha += .05; // increase with frame rate 24frs
    	if (container_mc.alpha >= 1)
    	{
    		container_mc.alpha = 1; //not go past 1
    		container_mc.removeEventListener(Event.ENTER_FRAME, animate);
    	}
    }
    function fade (event:Event):void
    {
    	container_mc.alpha -= .05; // increase with frame rate 24frs
    	if (container_mc.alpha <= 0)
    	{
    		container_mc.alpha = 0; //not go past 1
    		container_mc.removeEventListener(Event.ENTER_FRAME, fade);
    		container_mc.removeChild(course_mc);
    	}
    }
    
    
    course_mc.course_map.hl_1.addEventListener(MouseEvent.CLICK, loadMainImageh1);
    function loadMainImageh1(event:MouseEvent):void {
    	container_mc.alpha = 1;
    	container_mc.addEventListener(Event.ENTER_FRAME, fade);
    	ImageLoader.source = ("WhistlingHole1.swf");
    }
    course_mc.course_map.hl_1.addEventListener(MouseEvent.MOUSE_OVER, loadTexth1);
    function loadTexth1(event:MouseEvent):void {
    	Textfield.text="HOLE 1: A WELL-STRUCK CENTER OF THE FAIRWAY DRIVE OFF THE TEE SETS UP A MID TO LONG IRON APPROACH. A TEE SHOT DOWN THE LEFT SIDE FLIRTS WITH A SERIES OF BUNKERS AND DUNES, WHILE A TEE SHOT TO THE RIGHT CREATES A LONGER APPROACH FROM THE ROUGH. FAVOR THE RIGHT CENTER OF THE GREEN TO AVOID DEEP BUNKERS SHORT LEFT AND LONG.";
    }
    course_mc.course_map.hl_1.addEventListener(MouseEvent.MOUSE_OUT, unloadTexth1);
    function unloadTexth1(event:MouseEvent):void {
    	Textfield.text= "";
    }
    
    }
    //Main Menu buttons
    btn_1.addEventListener(MouseEvent.CLICK, loadMainImage1);
    function loadMainImage1(event:MouseEvent):void {
    	if (container_mc.getChildByName("course_mc") == null) {
    	ImageLoader.source = ("WhistlingHole1.swf");
    	}
    	else{
    		container_mc.removeChild(course_mc);
    		ImageLoader.source = ("WhistlingHole1.swf");
    	}
    }
    btn_2.addEventListener(MouseEvent.CLICK, loadMainImage2);
    function loadMainImage2(event:MouseEvent):void {
    	if (container_mc.getChildByName("course_mc") == null) {
    	ImageLoader.source = ("WhistlingHole2.swf");
    	}
    	else{
    		container_mc.removeChild(course_mc);
    		ImageLoader.source = ("WhistlingHole2.swf");
    	}
    }
    btn_3.addEventListener(MouseEvent.CLICK, loadMainImage3);
    function loadMainImage3(event:MouseEvent):void {
    	if (container_mc.getChildByName("course_mc") == null) {
    	ImageLoader.source = ("WhistlingHole3.swf");
    	}
    	else{
    		container_mc.removeChild(course_mc);
    		ImageLoader.source = ("WhistlingHole3.swf");
    	}
    }
    btn_4.addEventListener(MouseEvent.CLICK, loadMainImage4);
    function loadMainImage4(event:MouseEvent):void {
    	if (container_mc.getChildByName("course_mc") == null) {
    	ImageLoader.source = ("WhistlingHole4.swf");
    	}
    	else{
    		container_mc.removeChild(course_mc);
    		ImageLoader.source = ("WhistlingHole4.swf");
    	}
    }
    btn_5.addEventListener(MouseEvent.CLICK, loadMainImage5);
    function loadMainImage5(event:MouseEvent):void {
    	if (container_mc.getChildByName("course_mc") == null) {
    	ImageLoader.source = ("WhistlingHole5.swf");
    	}
    	else{
    		container_mc.removeChild(course_mc);
    		ImageLoader.source = ("WhistlingHole5.swf");
    	}
    }
    btn_6.addEventListener(MouseEvent.CLICK, loadMainImage6);
    function loadMainImage6(event:MouseEvent):void {
    	if (container_mc.getChildByName("course_mc") == null) {
    	ImageLoader.source = ("WhistlingHole6.swf");
    	}
    	else{
    		container_mc.removeChild(course_mc);
    		ImageLoader.source = ("WhistlingHole6.swf");
    	}
    }
    btn_7.addEventListener(MouseEvent.CLICK, loadMainImage7);
    function loadMainImage7(event:MouseEvent):void {
    	if (container_mc.getChildByName("course_mc") == null) {
    	ImageLoader.source = ("WhistlingHole7.swf");
    	}
    	else{
    		container_mc.removeChild(course_mc);
    		ImageLoader.source = ("WhistlingHole7.swf");
    	}
    }
    btn_8.addEventListener(MouseEvent.CLICK, loadMainImage8);
    function loadMainImage8(event:MouseEvent):void {
    	if (container_mc.getChildByName("course_mc") == null) {
    	ImageLoader.source = ("WhistlingHole8.swf");
    	}
    	else{
    		container_mc.removeChild(course_mc);
    		ImageLoader.source = ("WhistlingHole8.swf");
    	}
    }
    btn_9.addEventListener(MouseEvent.CLICK, loadMainImage9);
    function loadMainImage9(event:MouseEvent):void {
    	if (container_mc.getChildByName("course_mc") == null) {
    	ImageLoader.source = ("WhistlingHole9.swf");
    	}
    	else{
    		container_mc.removeChild(course_mc);
    		ImageLoader.source = ("WhistlingHole9.swf");
    	}
    }
    btn_10.addEventListener(MouseEvent.CLICK, loadMainImage10);
    function loadMainImage10(event:MouseEvent):void {
    	if (container_mc.getChildByName("course_mc") == null) {
    	ImageLoader.source = ("WhistlingHole10.swf");
    	}
    	else{
    		container_mc.removeChild(course_mc);
    		ImageLoader.source = ("WhistlingHole10.swf");
    	}
    }
    btn_11.addEventListener(MouseEvent.CLICK, loadMainImage11);
    function loadMainImage11(event:MouseEvent):void {
    	if (container_mc.getChildByName("course_mc") == null) {
    	ImageLoader.source = ("WhistlingHole11.swf");
    	}
    	else{
    		container_mc.removeChild(course_mc);
    		ImageLoader.source = ("WhistlingHole11.swf");
    	}
    }
    btn_12.addEventListener(MouseEvent.CLICK, loadMainImage12);
    function loadMainImage12(event:MouseEvent):void {
    	if (container_mc.getChildByName("course_mc") == null) {
    	ImageLoader.source = ("WhistlingHole12.swf");
    	}
    	else{
    		container_mc.removeChild(course_mc);
    		ImageLoader.source = ("WhistlingHole12.swf");
    	}
    }
    btn_13.addEventListener(MouseEvent.CLICK, loadMainImage13);
    function loadMainImage13(event:MouseEvent):void {
    	if (container_mc.getChildByName("course_mc") == null) {
    	ImageLoader.source = ("WhistlingHole13.swf");
    	}
    	else{
    		container_mc.removeChild(course_mc);
    		ImageLoader.source = ("WhistlingHole13.swf");
    	}
    }
    btn_14.addEventListener(MouseEvent.CLICK, loadMainImage14);
    function loadMainImage14(event:MouseEvent):void {
    	if (container_mc.getChildByName("course_mc") == null) {
    	ImageLoader.source = ("WhistlingHole14.swf");
    	}
    	else{
    		container_mc.removeChild(course_mc);
    		ImageLoader.source = ("WhistlingHole14.swf");
    	}
    }
    btn_15.addEventListener(MouseEvent.CLICK, loadMainImage15);
    function loadMainImage15(event:MouseEvent):void {
    	if (container_mc.getChildByName("course_mc") == null) {
    	ImageLoader.source = ("WhistlingHole15.swf");
    	}
    	else{
    		container_mc.removeChild(course_mc);
    		ImageLoader.source = ("WhistlingHole15.swf");
    	}
    }
    btn_16.addEventListener(MouseEvent.CLICK, loadMainImage16);
    function loadMainImage16(event:MouseEvent):void {
    	if (container_mc.getChildByName("course_mc") == null) {
    	ImageLoader.source = ("WhistlingHole16.swf");
    	}
    	else{
    		container_mc.removeChild(course_mc);
    		ImageLoader.source = ("WhistlingHole16.swf");
    	}
    }
    btn_17.addEventListener(MouseEvent.CLICK, loadMainImage17);
    function loadMainImage17(event:MouseEvent):void {
    	if (container_mc.getChildByName("course_mc") == null) {
    	ImageLoader.source = ("WhistlingHole17.swf");
    	}
    	else{
    		container_mc.removeChild(course_mc);
    		ImageLoader.source = ("WhistlingHole17.swf");
    	}
    }
    btn_18.addEventListener(MouseEvent.CLICK, loadMainImage18);
    function loadMainImage18(event:MouseEvent):void {
    	if (container_mc.getChildByName("course_mc") == null) {
    	ImageLoader.source = ("WhistlingHole18.swf");
    	}
    	else{
    		container_mc.removeChild(course_mc);
    		ImageLoader.source = ("WhistlingHole18.swf");
    	}
    }
    
    btn_FULL.addEventListener(MouseEvent.CLICK, loadMainImageFULL);
    function loadMainImageFULL(event:MouseEvent):void {
    	ImageLoader.source = null;
    	container_mc.alpha = 0;
    	container_mc.addEventListener(Event.ENTER_FRAME, animate); 
    	container_mc.addChild(course_mc);
    	course_mc.x = 0;
    	course_mc.y = 0;
    }

  2. #2
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Can you define what is crazy? I don't see any problem with the movie.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  3. #3
    Member
    Join Date
    May 2008
    Location
    Ireland
    Posts
    77
    http://www.3deagleview.com/flashtour...ngStraits.html

    hi cancerinform.
    after playing one or two of the external swfs, they start to go funny and the actual movies start to play incorrectly, as in the animation goes off to the left or off to the right etc.

  4. #4
    Member
    Join Date
    May 2008
    Location
    Ireland
    Posts
    77
    I've even stripped it down to the essentials and the swfs still go gaga.
    Last edited by Sircharles; 04-22-2010 at 10:48 AM.

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