Skip navigation
Currently Being Moderated

fullScreen problem

Sep 12, 2012 6:38 AM

I'm calling swf file (video player) through URL Loader. all controls are fine.

but i facing problem at fullscreen mode.

 

*my player is into a movieClip called as content_mc .

*that movieClip registration point is middle.

 

how can i solve this problem without changing registration point?

 

 

problem:

error.jpg

 
Replies
  • Currently Being Moderated
    Sep 12, 2012 6:59 AM   in reply to Venkom

    Center registration often requires positioning with negative x/y values.

     

    Just calculate the size of the video player and divide its height and width by 2 (half). The number you get is the amount you need to move into the negative. To negate the number just multiply it by -1.

     

    e.g.

     

    videoPlayerMC.x = int(videoPlayerMC.width / 2) * -1;

    videoPlayerMC.y = int(videoPlayerMC.height / 2) * -1;

     

    If your videoPlayerMC was 640 width, 480 height then the numbers returned would be x = -320, y = -240. I wrapped it in int() casting to make sure it's a whole pixel with no fraction.

     

    There's other ways but this is most verbose and easiest to understand.

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 12, 2012 6:50 AM   in reply to Venkom

    What code are you using for the x/y placement of the video player?

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 14, 2012 9:11 AM   in reply to Venkom

    On your first frame script update the y position of the contentBox like you are the x position:

     

    function updateSize(e:Event)

    {

        //Set background's size

        backgroundMC.width = stage.stageWidth;

        backgroundMC.height = stage.stageHeight;

        contentBox.x = stage.stageWidth/2;

        contentBox.y = stage.stageHeight/2;

    }

     

    Inside the contentBox frame script you use the stage's dimensions rather than the videos:

     

    if (e.fullScreen)

    {

        pLoader.x = int(stage.stageWidth/2)*-1;

        pLoader.y = int(stage.stageHeight/2)*-1;

       

        // rest...

    }

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 17, 2012 6:59 AM   in reply to Venkom

    You're welcome and good luck!

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points