Lyrica 75mg Pills $119.00

ActionScript 2.0 Flash

Lyrica 75mg pills $119.00 It’s not hard to make a SWF resize itself to the dimensions of the browser.  All it takes, lyrica 75mg pills $119.00 in fact, lyrica 75mg pills $119.00 is to set the width and height attributes of the HTML’s <object> <param> element and/or <embed> element to 100%.  There are a number of ways to determine the SWF’s display, lyrica 75mg pills $119.00 too:  show all (default) makes the entire movie visible while maintaining the original aspect ratio of the SWF (if the browser’s aspect ratio differs, lyrica 75mg pills $119.00 you’ll get the equivalent of “letterbox” borders either horizontally or vertically); no border gets rid those potential borders, lyrica 75mg pills $119.00 but may crop parts of the SWF instead; exact fit distorts the SWF, lyrica 75mg pills $119.00 if necessary, lyrica 75mg pills $119.00 to make the entire movie visible without borders or cropping.  See Adobe TechNote 12701 for complete details.

Lyrica 75mg pills $119.00 Fine and good.  Now, lyrica 75mg pills $119.00 what if you want to allow the Stage to resize, lyrica 75mg pills $119.00 but not its contents?  What if you want to adjust the position of various movie clips — such as a logo, lyrica 75mg pills $119.00 navigation, lyrica 75mg pills $119.00 or content area — in response to the Stage’s new dimensions as the browser is resized?  Luckily, lyrica 75mg pills $119.00 that’s not hard either.  :)   Let’s take a look. 

An answer, lyrica 75mg pills $119.00 short and sweet

Lyrica 75mg pills $119.00 Open a new FLA and draw a quick shape — a circle will do.  Convert the shape to a movie clip (Modify > Convert to Symbol…, lyrica 75mg pills $119.00 then choose Movie Clip) and give the clip an instance name via the Property inspector.  For this example, lyrica 75mg pills $119.00 let’s call it mcLogo.

Lyrica 75mg pills $119.00 Create a scripts layer and type the following into frame 1:

Stage.scaleMode = "noScale";
Stage.align = "TL";
var stageListener:Object = new Object ();
stageListener.onResize = positionContent;

function positionContent():Void {
   mcLogo._x = Stage.width - mcLogo._width;
   mcLogo._y = Stage.height - mcLogo._height;

Lyrica 75mg pills $119.00 Test your SWF, lyrica 75mg pills $119.00 and you’ll see the circle hug the lower right corner as you resize the SWF’s dimensions in Flash.  Either that, lyrica 75mg pills $119.00 or publish to an HTML file and set the width and height attributes for both the <option> <param> element and the <embed> element to 100% and resize the browser.

How it works

Lyrica 75mg pills $119.00 In the first line, lyrica 75mg pills $119.00 we’re telling the SWF not to scale itself.  In your HTML — this is important — you’re going to set the width and height to 100%, lyrica 75mg pills $119.00 but the SWF itself will not scale to fit those dimensions.  In the second line, lyrica 75mg pills $119.00 we’re telling the SWF to register itself to its upper left (top left) corner.

Lyrica 75mg pills $119.00 Next, lyrica 75mg pills $119.00 an arbitrarily named variable, lyrica 75mg pills $119.00 stageListener, lyrica 75mg pills $119.00 is declared as a generic Object instance.  This object acts as an “ambassador” for the Stage.onResize event, lyrica 75mg pills $119.00 so we need to assign a function to a new onResize property of our object, lyrica 75mg pills $119.00 rather than of Stage directly.  In this example, lyrica 75mg pills $119.00 the function is arbitrarily named positionContent() and is defined shortly below.  Note:  if you like, lyrica 75mg pills $119.00 you may assign a function literal …

stageListener.onResize = function() {
  // instructions here

Lyrica 75mg pills $119.00 … but in this case, lyrica 75mg pills $119.00 I chose a named function because you may want position dozens of movie clips, lyrica 75mg pills $119.00 and it’s arguably “cleaner code” to define the function separately. Lyrica 75mg pills $119.00  If you go the named function route, lyrica 75mg pills $119.00 as we’re doing, lyrica 75mg pills $119.00 make sure to omit the parentheses in this line, lyrica 75mg pills $119.00 as shown.

Lyrica 75mg pills $119.00 The next line adds our ambassador as a listener to the Stage.  The Stage.addEventListner() method is what “wires up” the listener object to the object that dispatches the event (here, lyrica 75mg pills $119.00 the Stage).

Lyrica 75mg pills $119.00 Finally, lyrica 75mg pills $119.00 the custom positionContent() function tells mcLogo what to do.  In this case the movie clip’s _x property is set to the width of the Stage minus its own width.  That makes it hug the right side.  To center this clip, lyrica 75mg pills $119.00 you could set its MovieClip._x property to half the Stage’s width minus half its own …

mcLogo._x = Stage.width / 2 - mcLogo._width / 2;

Lyrica 75mg pills $119.00 Follow suit for vertical positioning.  Makes sense, lyrica 75mg pills $119.00 right?  Be sure to call the positionContent() function after you declare it, lyrica 75mg pills $119.00 to make sure everything is positioned at the start, lyrica 75mg pills $119.00 otherwise the Stage/browser would have to resize first.

Lyrica 75mg pills $119.00 By the way, lyrica 75mg pills $119.00 this setup expects movie clips to be registered to their upper left corners.  If mcLogo’s shape was centered horizontally in its own timeline, lyrica 75mg pills $119.00 you would only have to minus half its width from the Stage’s width to make it hug the right hand side.  If you want a 20 pixel buffer between this right-aligned clip and the Stage, lyrica 75mg pills $119.00 account for that extra 20:

mcLogo._x = Stage.width - mcLogo._width - 20;

Lyrica 75mg pills $119.00 To keep a clip to the left side, lyrica 75mg pills $119.00 set its _x to 0.

Lyrica 75mg pills $119.00 Keep in mind, lyrica 75mg pills $119.00 you’re not limited to setting MovieClip._x and _y properties.  You may adjust a clip’s _width, lyrica 75mg pills $119.00 _height, lyrica 75mg pills $119.00 _xscale, lyrica 75mg pills $119.00 _yscale … whatever you like.  Experiment and have fun with it!  For every clip you wish to position, lyrica 75mg pills $119.00 simply add its entry to the positionContent() function.  Note, lyrica 75mg pills $119.00 below, lyrica 75mg pills $119.00 that an mcNav clip is being set to a position based on the original mcLogo clip.  Here, lyrica 75mg pills $119.00 both clips would hug the right edge of the Stage, lyrica 75mg pills $119.00 and mcNav would float below mcLogo, lyrica 75mg pills $119.00 with a buffer of 20 pixels.

function positionContent():Void {
  mcLogo._x = Stage.width - mcLogo._width;
  mcLogo._y = 20;
  mcNav._x = Stage.width - mcNav._width;
  mcNav._y = mcLogo._y + mcLogo._height + 20;

Lyrica 75mg pills $119.00 Note:  See How to Fix Wrong-sized SWFs in Firefox to work around a common issue with 100%-sized SWFs in Firefox.  (Thanks for the cross-reference suggestion, lyrica 75mg pills $119.00 Markus!)

Average Rating: 4.9 out of 5 based on 233 user reviews.

Leave a Reply