Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 449651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:47:26+00:00 2026-05-12T21:47:26+00:00

Greetings. I am developing an animated homepage for a Flash-HTML hybrid website, and for

  • 0

Greetings.

I am developing an animated homepage for a Flash-HTML hybrid website, and for the sake of standards, my solution is proving difficult. I am not a Javascript pro, so any help is appreciated!

Here is the run-down:

For Flash users, HTML page loads a variable-height AS3 Flash movie that will start at 556 pixels high, and after finishing its animation sequence, tween via Actionscript + JavaScript to 250 pixels high.

To kick off this movie sequence — (below-left) — I am attempting to set the initial height of the Flash movie via MooTools, so if users do not have Flash or Javascript enabled, they will see the shorter-height image area with alternative image content and HTML content revealed (below-right).

Element.setStyle sets the height just fine until swfObject runs, at which point the movie collapses since I am not specifying a height via CSS. If users do not have Flash, it defaults to the height of a static image.

So here is my question: Does anyone know how to dynamically pass a height variable to swfobject when it is set up to width/height @ 100%? Am I killing myself for no reason trying to work with two page heights?

Image Sequence:
Left – Initial Flash movie with HTML navigation below
Right – Resized movie at the end of the sequence with HTML nav & content below, looks the same as no-Flash version (static image)

alt text http://client.deicreative.com/op/images/twopages.jpg

                                           ^^ should land here for users w/o Flash

<script type="text/javascript">
  <!--
  window.addEvent('domready', function() {
     $('flashContent').setStyle('height', 556); // sets height for initial movie
     $('homeContent').setStyle('display', 'none'); // hides homepage text + photos below
     doSwfObject(); // attempting to start swfObject after setStyle is done
  });
  function resizePage(h) { // to be called from AS3
   var tweenObj = new Fx.Tween('flashContent');
   tweenObj.start('height', h);
  }
  function doSwfObject(){
   var flashvars = {};
   var params = { scale: "noScale" };
      var attributes = { id: "flashContent", name: "flashContent" };
   swfobject.embedSWF("swf/homeMovie.swf", "flashContent", "100%", "100%", "9.0.0", false, flashvars, params, attributes);
   alert(document.getElementById('flashContent').style.height); 
   // alerts & shows correct height, but page collapses after hitting 'ok'
  }
  //-->
</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T21:47:27+00:00Added an answer on May 12, 2026 at 9:47 pm

    I think the act of posting something on here helps me think through the problem — after doing so, the answer became more clear. So here is my solution for anyone who stumbles across this later.

    To animate the Flash movie’s height to its initial, taller state while preserving shorter height for non-Flash users (see images above), I use JavaScript the same way I would to tween the movie’s height once sequence is complete. The result resembles a push-down ad on a newspaper website.

    In AS3, after preloading is done, I tell Javascript to tween the height of the flash movie container (simplified, obviously — there is no preloading code):

    package {
       import flash.display.MovieClip;
       import flash.display.StageAlign;
       import flash.display.StageScaleMode;
       import flash.external.ExternalInterface;
    
        public class HomeMovie extends MovieClip {
    
           private var stageHeight:uint;
    
           public function HomeMovie(){
    
               this.stage.scaleMode = StageScaleMode.NO_SCALE;
               this.stage.align = StageAlign.TOP_LEFT;
    
               stageHeight = 556;
               // Tell javascript the stage needs resizing.
               if (ExternalInterface.available) {
               ExternalInterface.call("resizePage", stageHeight);
               }
            }
        }
    
    }
    

    In JavaScript (via MooTools):

    <script type="text/javascript">
    <!--
    window.addEvent('domready', function() { // hide content on home-page below movie
       $('homeContent').setStyle('display', 'none');
    });
    function resizePage(h) {
        var tweenObj = new Fx.Tween('flashContent', {
            property:'height',
            duration:500,
            transition:Fx.Transitions.Quad.easeOut
        });
        tweenObj.start(h);
    }
    //-->
    </script>
    

    I will probably take it one step further and check for Flash before hiding the home-page content, so that it will not occur if the user has Javascript but not Flash. Again, this is all for the sake of standards.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.