Maintaining Alignment/Distribution of Objects During Browser Scaling

Hello All,
I have been searching the forum for about two hours trying to
find the right code.
Basically, I want to have a site where the background scales
to the browser window proportionately and the buttons re-align
themselves around the perimeter. The content will be centered in
the middle of the browser.
I found the perfect piece of code for the background scaling.
What I want to have is a minimum flash size, say 500px. If
the browser window is scaled smaller then 500px, scroll bars
appear. There will be buttons along the top, bottom, and sides of
the stage. When the browser window is enlarged, the stage expands
with the buttons staying the same size and distribution between
each button on the stage is consistent. (more space between the
buttons when stage is expanded.) Also, the buttons will stay
position to the top, bottom, and sides of the browser.
I tried mixing other code from the forum with this scale code
below with bad results.
Any help would be great.
Thanks
Jessy

this works:
you can view it here http://cybermountainwebservices.com/fullBrowser/FullBrowserAS3.html
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
var bmp:Tile = new Tile(35, 35);
var tile:BitmapData = new BitmapData(35, 35);
tile.draw(bmp);
shelter.x = stage.stageWidth /2;
shelter.y = stage.stageHeight /2;
function fillBG(evt:Event = null):void {
  graphics.beginBitmapFill(tile);
  graphics.moveTo(0, 0);
  graphics.lineTo(stage.stageWidth, 0);
  graphics.lineTo(stage.stageWidth, stage.stageHeight);
  graphics.lineTo(0, stage.stageHeight);
  graphics.lineTo(0, 0);
  graphics.endFill();
shelter.x = stage.stageWidth /2;
shelter.y = stage.stageHeight /2;
fillBG();
stage.addEventListener(Event.RESIZE, fillBG);
in  this case the fill is with a 35pxl x 35pxl gif file but you could just as easily use a color the item called shelter is the name of the jpg in the center.
when you do this be sure in your publish settings to set dimension to percent 100 x 100  if you cont want a border or scrollbars around the outside be sure to set this css rule in your html   body {margin:0; padding:0; overflow:auto}

Similar Messages

  • How do I create multiple objects during runtime?

    I don't know how to create multiple objects during runtime, here's my problem:
    I get a String as input. Then I create an object called newobject. I put the object in a hashtable with the above string as key.
    Then comes the problem, in order to create a new object, I have to rerun the same class, which uses the same name (newobject) to create a 2nd object. Now my hashtable doesn't reference to my 1st object anymore...
    Is there anyway I can fill up the hashtable with different objects, and make each key point to each object it was supposed to?
    For those who want to see a bit of the program:
    public class PlayBalloon{
    public Hashtable ht = new Hashtable();
    for(){
    Balloon pB = newBalloon;
    newBalloon=new Balloon(pB);
    ht.put("Some input from user", newBalloon);
    for(){
    ht.get(s).draw;<= s=string, draw=own meth. in Balloon
    }

    I think i can see the problem that you are having. You have, in effect, duplicate keys in your hashtable - ie, two strings used as keys with the same name.
    The way that a hashtable works is as follows...
    When you ask for a value that is mapped to a key it will go through the table and return the first occurence it finds of the key you asked for. It does this by using the equals() method of whatever object the key is (in your case it is a String).
    If you cant use different Strings for your keys in your hashtable then i would consider writing an ObjectNameKey class which contains the String value that you are trying to put in the hashtable and an occurrence number/index or something to make it unique. Remember to override the equals method in your ObjectNameKey object or else the hash lookup will not work. For example
    class ObjectNameKey {
        private String name;
        private int occurence;
        public ObjectNameKey(String name, int occ) {
            this.name = name;
            this.occurence = occ;
        public String getName() {
            return name;
        public String getOccur() {
            return occurence;
        public boolean equals(Object o) {
            if (!(o instanceof ObjectNameKey)) {
                return false;
            ObjectNameKey onk = (ObjectNameKey)o;
            if (onk.getName().equals(name) && onk.getOccur() == occurence) return true;
            return false;

  • Is it normall for a Macbook Pro to overheat during  browsing web pages?

    DonAnan
    Is it normall for a Macbook Pro 13" retina 2 weeks old to overheat during browsing web pages ?
    i just brought a new MacBook Pro 13" Retina ( Dual Core i5 2.6GHz , 8GB Ram , 512GB Flash Storage ) and i notes that its really get OVERHEAT on the top right side of the keyboard and the fans work loudly when i brows web or play a game ( CSR Racing ) , it get heat that when i touch the top right side of the keyboard ( the aluminum body on top of the bower key exactly ) i cant keep my finger for morethan 10 or 15 second ..
    and the battery wont last for morethan 4 or 5 hours while it supposed to last for 9 hours according to Apple.
    so guys is this normal ?
    Thanks ,

    i've did some search on the same issue and it really seems like everyone have it , even thou at apple reseller showroom here in Doha-Qatar the sales man told me this a such issue in the retina macbooks and apple has admit it and you must take it to the service center and change it , while at the service center said a totally different things and that its fine to get heat ..
    in meanwhile my way back i pass by another apple reseller showroom and they clearly said if ur mack gets heat u must go and change it ...
    im really lost and i have no idea whats goin on here and whom should i listen to .. i hope someone from APPLE support will read this and reply us whats goin on ?     

  • Creation of Disctribution Model view using Distribution using object classe

    Hi All ,
             Can anybody tell me how to create distribution model through  Distribution using object classes option in SALE transaction(Path : SALE - > Modelling and implementing Business processes - > master data Distribution - > Distribution using object classes).What is the difference between normal distribution model creation through BD64 and creating in the above way?
    Please help me its urgent.Thanks in advance.
    Regards,
    Rakesh.

    Hi All ,
             Can anybody tell me how to create distribution model through  Distribution using object classes option in SALE transaction(Path : SALE - > Modelling and implementing Business processes - > master data Distribution - > Distribution using object classes).What is the difference between normal distribution model creation through BD64 and creating in the above way?
    Please help me its urgent.Thanks in advance.
    Regards,
    Rakesh.

  • CS3 Extension that initializes a JS-Object during startup is not working in CS4

    Here is a simple Extension that works fine in DW CS3 and doesn't work in DW CS4 (trial version):
    The File myObj_Startup.htm was placed in Folder Configuration/Startup. It initializes a quite simple Javascript-Object during Startup of DW.
    Content of myObj_Startup.html:
    <!-- MENU-LOCATION=NONE -->
    <HTML>
    <HEAD>
    <TITLE>beim &Ouml;ffnen</TITLE>
    <SCRIPT LANGUAGE="javascript">
    myObj =
         showMsg : function (msg)
             alert(msg);
    function onOpen()
       myObj.showMsg("startup");
    // SCRIPT ENDE
    </SCRIPT>
    </HEAD>
    <BODY onLoad="onOpen();">
    </BODY>
    </HTML>
    Besides this, an additional menuitem was defined in menus.xml to use the JS-object myObj:
    <menu mmstring:name="menus/DWMenu_File" id="DWMenu_File">
            <menuitem name="Test" command="myObj.showMsg('Testing');" enabled="true" domRequired="false" id="DWMenu_File_SIEMENSTEST" />
            <menuitem mmstring:name="menus/DWMenu_File_New" key="Cmd+N" command="dw.newDocument()" enabled="true" domRequired="false" id="DWMenu_File_New" />
    With Dreamweaver CS3 everything works out fine: I get a Alert-message: "startup" during Startup and when I'm clicking Menu->File->Test I get a Alert-message: "Testing".
    With Dreamweaver CS4  (trial version) I get a message: "startup" as well but when I'm clicking Menu->File->Test I get no message.
    Instead I get a Logfile "C:\Documents and Settings\user\Application Data\Adobe\Dreamweaver CS4\en_US\Configuration\Logs\DW JavaScript.log" telling me:
       JS Error:
           myObj is not defined
           filename:
           lineno: 0
           While executing DWMenu_File_TEST command in menus.xml, the following JavaScript error(s) occurred:
           ReferenceError: myObj is not defined
    Why is this simple extension working in DW CS3 and not working in DW CS4?
    Did they change the treatment of JS-objects initialized during startup?
    Is the object out of scope?
    Are such extensions not working in trial versions of DW CS4?
    I cannot explain this behavior - please help!

    Hi,
    I have an similar problem and couldnt find an workaround for the problem.
    When i add an new menu item to the menus.xml file, the menu item shows up, but my custom command (simple alert) wont trigger.
    Can somebody please help?

  • Maintain no. range for object j_1irg23d, for 2011, excise group,

    Hi experts,
                        I m doing a depot sales process STO done, delivery done, Invoice done and excise invoice done, Now while MIGO
    the error is coming maintain no. range for object j_1irg23d, for 2011, excise group . in j1i9 i have maintained all the no. ranges for all the registers in all the plants and excise groups. Then too the error is coming. plus in MIGO the base value in excise duty tab in not been picked, i have to give manually. is that procedure correct?
    Thanks
    Prashant

    Hi all,
    I just made a silly mistake like other no. ranges i gave the serial no. of the number range as 10 or 20 which was wrong it has to be from the start i tried putting it as 01 the no. range picked up.
    Regards
    Prashant

  • How to dereference objects during export flow

    Hello!
    I would like to export information from a referenced object during export flow but the referenced object is not part of the connector space object of the affected management agent. This is my demo configuration:
    testEmployeeData:
    - employeeId (anchor)
    - personId (reference to testPerson object)
    - telephoneNumber
    - uid
    testPerson:
    - displayName
    - givenName
    - sn
    - uid (anchor)
    - employeeData (multi-value reference to testEmployeeData recors; can be null)
    I have an SQL agent ("HR") that imports person and employeeData objects into the metaverse. The references seem to work as I can see them in the Sync Service Manager and they point to the right objects too. Now I would like to access some of the
    referenced objects' data during export attribute flow. I have configured an export-only "Persons" agent that should export the personal data into an attribute-value file. This is what I would like the export flow to look like:
    displayName <- testPerson.displayName
    employeeId (multi-value) <- testEmployeeData.employeeId (*)
    firstName <- testPerson.firstName
    lastName <- testPerson.sn
    uid <- testPerson.uid
    The problem is now the advanced attribute flow marked with (*). The testPerson.employeeData field contains a multi-valued reference to all matching employeeData records which contain the employeeId. The output file should contain all matching employeeIds
    instead of the reference values (GUIDs) but I can't get this to work. When I try to configure an advanced export flow rule flowing testPerson.employeeData to person.employeeId I just receive an error message stating that metaverse reference attributes cannot
    be defined as source attributes.
    Do I have to create an appropriate connector space object for this to work? Or is there some other way to dereference objects in order to get certain attributes? By the way, the person connector space object in the "Persons" agent is created by
    provisioning code based on testPerson metaverse objects.
    Regards,
    Philipp

    Philipp,
    What you are trying to do cannot be accomplished the way you are trying to do.
    Here are your options:
    Use classic provisioning using rules extensions or
    Use a workflow to deference attributes in FIM Service and flow flattened data into the target connector space.
    My recommendation is to use the second option to accomplish what you are trying to do as I prefer to stay away from classic code for maintenance and support reasons.
    Good Luck.
    Thanks,
    Jameel Syed |
    Identity & Security Strategist | [email protected] |
    Simplified Identity and Access Management

  • Track the qeries that accessed a particular object during a time period

    HI,
    I have a list of objects on my schema and i need to track the list of sql queries by different users that accessed by object during this time period.
    i haven't enabled any auditing yet.
    is there any way i can get that list of queries and their schemas that accessed those particular objects during a particular time period.
    Can someone guide me please.
    Thanks in advance.
    Philip.

    Too bad you don't have a version number. Oracle functionality changes from version to version and in some versions you can do this and in some you can not.
    Look here for one way to accomplish the task:
    http://www.psoug.org/reference/dbms_fga.html
    Here for another:
    http://www.psoug.org/reference/audit_vault.html
    Here for another:
    http://www.psoug.org/reference/dbms_logmnr.html
    Consider posting more information when asking questions in the future.

  • Call Webservice/API during browser close event

    Hello,
    I am using JDEV 11g. My application catches the browser close event to call a return Task Flow.
    I am wondering if its possible to call a webservice/API during the same event.
    Thanks
    Padmapriya

    Probababy too late to ask .. did u manage to get this resolved.
    I am not able to call any server Listeners during browser close event ...
    Details here -Re: Calling an ActionListener on browser window close using JS event queuing

  • Creating customer without maintaining common distribution channel and divis

    Dear all...
    can anybody tell me how to create a customer without maintaining common distribution channel & division..
    sathsdn..

    Hi
    Welcome to SDN
    Not possible
    Because whenever you are going to create customers /materials or conditions for a distribution channel the system is going to check the reference distribution channel in VOR1 (whether any entry is there) and will accept when there is entry there only
    Similarly
    Because whenever you are going to create customers /conditions for a division the system is going to check the reference division in VOR2 (whether any entry is there) and will accept when there is entry there only
    Without configuring VOR1 and VOR2 creating master data is not possible
    If you dont want to havecommon distribution channel or division keep the same as common
    Suppose in VOR1 for 1000,10 if you have to define  common distribution channel then you can maintain as Ref DC customers /materials  as 10 (the same) and Ref DC for conditions as also 10 (the same)
    Regards
    Raja

  • Passing a object from browser to server

    How can i pass a java object from browser to server, can anybody help me in knowing this?
    Rajesh.

    You might need to clarify this. What exactly do you need to do? You can't pass anything from a browser except HTML, other than by attachment. If you have a Java object, then I assume that you are using JSP or something that supports Java, in which case you are already using server-side semantics.
    If however, you mean Javascript, that's a whole other problem, as it is client side only.
    Perhaps if you clarify what you are trying to do someone can give you a good answer.
    Regards,
    Paul

  • Transform handles are moving the object and not scaling.

    I've been running into trouble with the transform handles on objects moving the object instead of scaling/stretching the object. It seems to happen on the bottom and right sides vs the top and left sides. When I have the mouse over the handle it shows the scaling icon, but when I press the mouse it turns into the black selection arrow. Is anyone else experiencing this and know how to fix it?

    kjredin,
    I am afraid you have come across the Live Rectangle bug which is limited to the MAC versions starting with 10.7 and 10.8, but not 10.9 (Mavericks) or 10.10 (Yosemite). Hopefully, the bug will be fixed soon.
    So a switch to Mavericks or Yosemite with a reinstallation might be the way to solve it here and now.
    To get round it in each case, it is possible to Expand the Live Rectangles to get normal old fashioned rectangles, or to Pathfinder>Unite, or to use the Scale Tool or the Free Transform Tool.
    A more permanent way round that is to create normal old fashioned rectangles, after running the free script created by Pawel, see this thread with download link:
    https://forums.adobe.com/thread/1587587

  • Align to locked objects in Illustrator

    Hello,
    I recently switched from Freehand to Illustrator. In Freehand you could lock an object or group and align other objects to the locked ones. In Illustrator this is not possible, because you cannot select an object that is locked.
    How can I do this, then ? Can't believe that this shouldn't be possible !
    Thank you.

    why are you locked the object first select the object after that center point will appear you click on it after  that  select another object which is align the first object verticall horizentally
    khurram shah

  • Why does firefox 4 hang in some websites, during browsing on that site ? This never happened with previous editions.

    why does firefox 4 hang in some websites, during browsing on that site ? This never happened with previous editions. edit
    Details

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    Create a new profile as a test to check if your current profile is causing the problems.<br />
    See [[Basic Troubleshooting#Make_a_new_profile|Basic Troubleshooting&#58; Make a new profile]]<br />
    There may be extensions and plugins installed by default in a new profile, so check that in "Tools > Add-ons > Extensions & Plugins"<br />
    If that new profile works then you can transfer some files from the old profile to that new profile (be careful not to copy corrupted files)
    See http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • HOW CAN WE CHANGE THE LOCATION OF TEMPORARY FILES DURING BROWSING?

    IN ORDER TO WATCH VIDEOS A LARGE AMOUNT OF MEMORY IS REQUIRED. BUT THE DRIVE IN WHICH FIREFOX IS INSTALLED HAS MORE NUMBER OF PROGRAM FILES. IS THERE ANY WAY TO CHANGE THE LOCATION OF THE TEMPORARY FILES THAT GET ACCUMULATED DURING BROWSING?

    You probably need to change the value of the %temp% and %tmp% environment variables in:
    Control Panel > System > Advanced > Environment variables
    You can set the location of the Firefox cache by setting a pref to that location.<br />
    See http://kb.mozillazine.org/browser.cache.disk.parent_directory
    To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
    If you see a warning then you can confirm that you want to access that page.<br />

Maybe you are looking for