dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: _width & _height

  1. #1
    Arckid - Curving the Web
    Join Date
    Dec 2000
    Location
    India
    Posts
    1,412
    anybody knows how to obtain width and height of FLV by programming?

  2. #2
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    A few steps, but this is how to do it.

    Open your library:

    Window>Library

    In the top right hand corner open the dropdown meny and select "New Video". This will place an empty embedded video symbol in your library.

    Now, select the new symbol in the library and name the symbol, by right-clicking it and selecting rename.

    Now, select the embedded video symbol we just created in the library and right-click, choose properties from the meny that appears. A new window will open, inside this window, click the "import" button and the navigate the location of your .flv file. Click open and the .flv file will be imported into the video symbol.

    Now you need to drag an instance of this symbol from the library and onto the stage.

    Right-click the new instance on the stage and choose properties. In the properties inspector, enter an instance name for the symbol in the "instance name" field.

    Now using actionscript, you can get the width and height of this instance just as you would be able to with any other movieclip:

    Code:
    movieinstancename.width
    movieinstancename.height

    [Edited by FlashGuru on 08-01-2002 at 02:59 AM]

  3. #3
    Arckid - Curving the Web
    Join Date
    Dec 2000
    Location
    India
    Posts
    1,412
    hi flashguru ...

    the way you explained is good but ...i dont want to do that way ...

    suppose there is one application i made with flash MX and Flash Com server ...

    so there are 2 parts in the applciation .. recording and replying ... or say playing the videos which are recorded previously by the recording section ....

    now the recording section gives freedom to user that he can record the video's in customized size (width x height), fps etc.,

    so it will create the file ... accroding to the customized width and height ...

    now the question arrises in the playing section ... when the user want to play ... what i have is just FLV file ... nothing else .... and so i have to do all by action scripting or say by server side ActionScripting ....

    hope you got my question now ...

    and again thanks for your quick answer and time ...

    one another thing ... i mailed you about that Flash Developers wanted at your site ... you also replied me ... but now what to do next? i am arckid ...

  4. #4
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    To play a recorded stream you need to attach it to a Video object for it to be displayed, all Video objects have a width and height property as i mentioned previously:

    Code:
    // First attach the stream to the Video object
    myVid.attachVideo(videoSource);
    // Then make sure the video object is the same size as the
    //published video steam
    myVid._width = myVid.width
    myVid._height = myVid.height

  5. #5
    Arckid - Curving the Web
    Join Date
    Dec 2000
    Location
    India
    Posts
    1,412
    hi,

    thanks for the reply ... i will try it ...


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