A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: expanding/resizing swf on the website???

  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    13

    Unhappy expanding/resizing swf on the website???

    hi all

    allright,i have this flash intro/main page for my website. and it suppose to play animation as an intro/main page and wait for user to click on any of the icons displayed. once user clicks , i want the window(size of 700*900) to resize or cut off the bottom part of the page to form it as a header. so that i can display it as a header without uploading another swf file.

    im very new to Dreamweaver.
    so im pretty lost when it comes to javascripts.

    please some one help.

    thanks in advance.

  2. #2
    newb of many sorts Ralgoth's Avatar
    Join Date
    Apr 2002
    Posts
    466
    I don't have a very clear picture of what you're trying to accomplish, but javascript does sound like the answer. You can use jQuery to resize your flash area, and rearrange page elements (like your header).

    Also, if your Icons are within the swf, you'll need to use ExternalInterface in flash to trigger your javascript function.
    Search first, asked questions later.

  3. #3
    rabid_Delineator AttackRabbit's Avatar
    Join Date
    Dec 2003
    Location
    Orlando, Florida
    Posts
    481
    If the icons are within the flash movie , then your are going to have to use external interface to call out to a javascript method either in an external .js file or in the html page in which the flash content is written to. In the javascript method , you would just target the div that contains the flash , usually by id , but you can also target it by name , and then resize its height by adjusting its style attribute. Just a warning , this is not good practice. Some browsers , under certain security setting will see this as malicious.

  4. #4
    Junior Member
    Join Date
    Nov 2009
    Posts
    13
    Quote Originally Posted by Ralgoth View Post
    I don't have a very clear picture of what you're trying to accomplish, but javascript does sound like the answer. You can use jQuery to resize your flash area, and rearrange page elements (like your header).

    Also, if your Icons are within the swf, you'll need to use ExternalInterface in flash to trigger your javascript function.
    hi there
    thanks for replying. here is the link for what im trying to achieve.
    http://danielmclaren.net/2008/04/exp...ing-javascript

    i want my intro page to transfer into menu header type of thing.
    ... but the link is bit too difficult to understand as im very new to javascript and dreamweaver.

    thanks again

  5. #5
    Junior Member
    Join Date
    Nov 2009
    Posts
    13

    Unhappy

    Quote Originally Posted by Ralgoth View Post
    I don't have a very clear picture of what you're trying to accomplish, but javascript does sound like the answer. You can use jQuery to resize your flash area, and rearrange page elements (like your header).

    Also, if your Icons are within the swf, you'll need to use ExternalInterface in flash to trigger your javascript function.
    Quote Originally Posted by AttackRabbit View Post
    If the icons are within the flash movie , then your are going to have to use external interface to call out to a javascript method either in an external .js file or in the html page in which the flash content is written to. In the javascript method , you would just target the div that contains the flash , usually by id , but you can also target it by name , and then resize its height by adjusting its style attribute. Just a warning , this is not good practice. Some browsers , under certain security setting will see this as malicious.
    Thanks for your input.. http://danielmclaren.net/2008/04/exp...ing-javascript does this link saying the same thing u r saying. or im just too lost?

    do you think you can point to direction where actually explains everything step by step?

  6. #6
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    you'll an understanding of css, xhtml, js and external interface to really grok how this works.
    You may want to try http://swffit.millermedeiros.com/ as a bit of helper for now.

    Just a word to the wise, intro pages are known as failure pages because most users will just leave rather than wait for the info they came for.

  7. #7
    rabid_Delineator AttackRabbit's Avatar
    Join Date
    Dec 2003
    Location
    Orlando, Florida
    Posts
    481
    As a starting point with any problem you should begin by breaking the task into smaller, manageable chunks. First thing i would do is learn how to use external interface. It might sound intimidating , but it is very , very easy. You simply import the external interface class , and make a call out to a javascript method in your page. Start by just having your flash app , call the method , and do nothing in the js method but call an alert("made it to the js method");. A great starting point is always livedocs. It will almost always answer any basic to intermediate questions you have.

    http://livedocs.adobe.com/flash/9.0/...Interface.html

    Once you familiarize yourself with this procedure , get rid of the alert , replace the string inside the alert , with some code that will hopefully target your div , or page element , containing your flash. the syntax can vary from browser to browser , so do your homework on this. But this article explains some basics
    https://developer.mozilla.org/En/DOM...getElementById

    Once you are successfully alerting the targeting div , get rid of the alert all together. And try modifying the style attribute.

    which would be

    Code:
    myDIV.style.height
    By this point you should have accomplished what you are trying to do. If you want , do some more research on css and div tags , and specifically the style attribute. The w3c site is a great place for widely excepted standards and conventions.

  8. #8
    Junior Member
    Join Date
    Nov 2009
    Posts
    13

    Thumbs up

    Quote Originally Posted by AttackRabbit View Post
    As a starting point with any problem you should begin by breaking the task into smaller, manageable chunks. First thing i would do is learn how to use external interface. It might sound intimidating , but it is very , very easy. You simply import the external interface class , and make a call out to a javascript method in your page. Start by just having your flash app , call the method , and do nothing in the js method but call an alert("made it to the js method");. A great starting point is always livedocs. It will almost always answer any basic to intermediate questions you have.

    http://livedocs.adobe.com/flash/9.0/...Interface.html

    Once you familiarize yourself with this procedure , get rid of the alert , replace the string inside the alert , with some code that will hopefully target your div , or page element , containing your flash. the syntax can vary from browser to browser , so do your homework on this. But this article explains some basics
    https://developer.mozilla.org/En/DOM...getElementById

    Once you are successfully alerting the targeting div , get rid of the alert all together. And try modifying the style attribute.

    which would be

    Code:
    myDIV.style.height
    By this point you should have accomplished what you are trying to do. If you want , do some more research on css and div tags , and specifically the style attribute. The w3c site is a great place for widely excepted standards and conventions.
    thanks a lot. i will try out your approach/steps first and get back to you.

    thanks again. really

  9. #9
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    Just remember that your flash movie should be ready for the change. Set the stage alignment and scalemode to topLeft and None respectively and set up a RESIZE listener so that you can react to the change the way you want within actionscript.

  10. #10
    Junior Member
    Join Date
    Nov 2009
    Posts
    13
    thanks guyz.. really.. thank you ..

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