• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 535
  • Last Modified:

Repositioning a calendar (swf) within a flash website

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?
0
TCUBusiness09
Asked:
TCUBusiness09
  • 3
1 Solution
 
Aneesh ChopraCommented:
it should like this:

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

}
0
 
TCUBusiness09Author Commented:
Thank you for your help! I will try this out tomorrow and get back to you with the results.
0
 
blue-genieCommented:
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.addListener(mclListener);
image_mcl.loadClip("test2.swf", 1);

Open in new window

0
 
TCUBusiness09Author Commented:
aneeshchopra, you code seems to be loading up the calendar file, but it is not visible. Is it possibly on the wrong layer?
0
 
TCUBusiness09Author Commented:
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!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now