A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Can someone tell me how to remove window controls?

  1. #1
    Member
    Join Date
    Sep 2000
    Posts
    40

    Cool

    Hey ....I want to copy something i saw on http://devlab.swift3d.com
    they had two really cool things going on when you enter the site ...the window 1. starts off small and resizes ....that's cool I got the java for that.....
    but they also have no controls...no bottom bar(progress)
    and no maximise button.....!!
    Kewl..
    I tried the source...it's in another file....has anyone seen how to do this somewhere or csn be arsed to explain? is this javascript as well?

    Thanks a lot all


  2. #2
    Junior Member
    Join Date
    Sep 2000
    Posts
    17
    All you need to do is use the window.open command like this in the JavaScript section in your html header.

    Code:
    function myFunction(){
    window.open("FlashMovie.htm","newWinodw","menubar=0
            toolbar=o statusbar=0 scrollbars=0 width=200 heigth=200")
    }
    Simply call this javascript function in your html. <a href="JavaScript:myFunction()">

    Check out this link from webreference for a list of the available properties you can set this way. Be warned though both Netscape and IE act differently.

    http://www.webreference.com/js/column7/attributes.html

    martin.

  3. #3
    Member
    Join Date
    Sep 2000
    Posts
    40

    Cool thanks bro

    cool thanks a lot.....

    So now ...if i want to say set the window in the center and have it work in both netsacape and I.E do I have to put both syntax...i.e screenX=number left=number screenY=number top=number .......
    and what do I put between it...i.e

    is it just a " before all the values and " to close...

    " fullscreen=yes height= 800 e.t.c"

    tute link would be great.....

    and can I call the function with get url?

    thanks all

  4. #4
    Junior Member
    Join Date
    Sep 2000
    Posts
    17
    To be honest Ive had some trouble with window sizing and have tried various experiments with both netscape and IE.
    My advise is to only set some properties using the window.open() function and define final size and postitioning in the page that has been opened. I find this way I can have greater control over viewers experience. Some of the settings such as fullscreen whos syntax is simply fullscreen I find impossible to use in a practicle internet environment. I only use this if I know which browser is used, such as an Intranet environment.

    The basic syntax for the window.open() command is

    window.open(FileToOpen,NameOfWindow,Properties)
    • FileToOpen = The file or HTML page you wish to open

      WindowNAme = You have to give the window a name

      Properties = the Window settings.


    Here a quick example of a way I use the command to control new opening windows. Firstly I want to define the page Im opening and get it to correctly size itself. This works with both Netscape and IE.

    I placed this script tag in the header.

    Code:
    <script language="JavaScript">
    <!--
    
    WantedSize_x = 300;
    WantedSize_y = 400;
    
    function size_me(){
       window.resizeTo(WantedSize_x,WantedSize_y);
    }
    //-->
    </script>
    I call this simple script from an onload event in the <BODY> tag.
    Code:
    <BODY onload="JavaScript:size_me()">
    This will cause the new window to resize itself to what ever settings are defined. I called this page OtherWindow.htm

    Then in the <SCRIPT> tag of the page that holds my flash movie I define simple properties to open a new window.

    Code:
    function New_minimal(fileIS){
        filePath = fileIS;
        WindowProps= "scrollbars=0 menubar=0 toolbar=0 statusbar=0";
        window.open(filePath,"NewWindow",WindowProps)
    }
    I then simply call this function with a getURL() function in my action script. I have aded a fileIS variable in the above code to enable you to pass to the java what file you wish to open, direct from you flash movie.

    Code:
    getURL("JavaScript:New_minimal('OtherWindow.htm')")
    Try it! It should open the new page in a new window that resizes itself to the desired settings. Ive included a few pointers such as the parseing of data to the JavaScript function. The bit in the ('....') after the function call. and the (fileIs) in the function script.

    As for Tute's My best advice is check out all the ones here on Flash kit... there ACE and also [link]www.webdeveloper.com[/link] who have a massive array of info about everything to do with Scripting and the Like

    martin

  5. #5
    Member
    Join Date
    Sep 2000
    Posts
    40

    Cool great!!!

    Thanks m8 you're a *


    I'd done some mods and it's all cool.......I've only got one prob still....how can I set a relative size....i.e
    60%x50% for the new window ...also I've taken out the wantedsize bits ...and used the tim booker script for the devlab effect...only prob is it's all pixels...
    i'm making do with 550x400 now.....but I want to use
    the get url to call something like this
    Javascript:TB_animateWindow(550,400,800,600,80,20, false)
    but if the client res was 640x480 it'd go off screen....
    I checked out the devlab script as the y seem to be ok....but it's over my head........also...I added location=0 to window props to get it centered is that right it seems ok...I just took it from the devlab stuff...
    Thnaks again for all the help

  6. #6
    Junior Member
    Join Date
    Sep 2000
    Posts
    17
    Start the JavaScript of the new page with..

    scr_x = screen.availWidth;
    scr_y = screen.availHeight;


    This will pass the screen size x & y to the two variables. you can then multily these to get a percentage.
    WantedSize = scr_x * 0.50;

    To maike a window for instance open dead center and exacly half the size of the screen try something like this:
    Code:
    <script language="JavaSCript">
    <!--
    
    scr_x = screen.availWidth;
    scr_y = screen.availHeigth;
    window_x = scr_x * 0.5;
    window_y = scr_y * 0.5;
    Center_of_x = scr_x / 2;
    Center_of_y = scr_y / 2;
    Window_center_x= window_x / 2;
    Window_center_y = window_y / 2;
    Top_left_of_window_x =Center_of_x - Window_center_x;
    Top_left_of_window_y =Center_of_y - Window_center_y;
    
    function move_and_size_me(){
        window.resizeTo(window_x,window_y);
        window.moveTo(Top_Left_of_window_x,Top_left_of_window_y);
    }
    //-->
    </script>
    Calling the move_and_size_me() function from the html <BODY> tag with an onload event will cause the window to resize and move itself. All I'm doing here is get the screen size form the screen object and multiplying to get a relative percentage. window_x = scr_x * 0.5; simply change what scr_x is multiplied by to obtain diferent percentage. The script then works out from these screen dead center Center_of_x = scr_x / 2; and then the top lefthand corner position for the window Top_left_of_window_x =Center_of_x - Window_center_x; The function you call from the body simply resizes and moves the window the those positions.

    martin

  7. #7
    Member
    Join Date
    Sep 2000
    Posts
    40

    Cool m8 you're the phattest



    sorted......I'll try that now....yeah ...I saw that on the devlab ..but didn't get it ...the multiply by .x is wicked that should be fine........thanks ...so much....I'll try this out I was gonna have a redirect for resolution script but this'll be much better....
    it's gonna look sweet ...just need a good design now...lol
    ok well I'll seee how i get on....thanks again that was quite a lot of questions I had

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center