Repositioning a calendar (swf) within a flash website

Posted on 2008-11-17
Last Modified: 2013-11-11
One other question that I do have is now that I have loaded the calendar using:

on(release) {
loadMovie ("calendar8_01.swf", 1);

How do I position the new window where I want it within my flash site. It is loacated by default in the top left corner, but I am wanting it to be in the middle of the screen both horizontally and vertically. Is this possible?
Question by:TCUBusiness09
    LVL 34

    Expert Comment

    by:Aneesh Chopra
    it should like this:

    on (release) {
          var mc = this._parent.createEmptyMovieClip('calendarHolder', 1);
          mc._x = 50;
          mc._y = 50;


    Author Comment

    Thank you for your help! I will try this out tomorrow and get back to you with the results.
    LVL 39

    Accepted Solution

    hi just a add on from your previous post.

    if you want better control over the items you're loading, try using MovieClipLoader (AS2) and Loader (AS2 & 3) classes for loading items.
    in AS3 levels aren't used anymore, so get into the habit of using display objects (for AS3).

    in AS2 when using loadMovie(whichmovie);
    generally you only tell it what to load
    when using loadMovieNum(whichmovie, whichlevel);
    you have the extra parameter of the level.

    you can use moviecliploader to load into levels (AS2)

    have a look at the snippet below.
    i create an instance of the movieclip loader.
    then i create a listener.
    when the listener says INIT i.e. finished loading you can access it now.
    i set the items x position.

    so you can do the same with your calendar.
    var mclListener:Object = new Object();
    mclListener.onLoadInit = function(target_mc:MovieClip) {
    target_mc._x = 500;
    var image_mcl:MovieClipLoader = new MovieClipLoader();
    image_mcl.loadClip("test2.swf", 1);

    Open in new window


    Author Comment

    aneeshchopra, you code seems to be loading up the calendar file, but it is not visible. Is it possibly on the wrong layer?

    Author Closing Comment

    blue-genie, extrordinary work yet again. All I had to do was put your code in the on(release) handler and modify the position and it worked perfectly. You have been such a great help throughout this process. Thanks again!

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
    While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
    The goal of the tutorial is to teach the user how to how to record live broadcast.
    The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now