Skip navigation
CarolWasp
Currently Being Moderated

Header and Footer in flash

Jan 16, 2013 11:46 AM

Ok. This was supposed to be a question about a header and footer in Flash. I intended to attach my fla to make it possible to understand what I was saying. As it turns out I can't figure out how to attach files. Is it even possible? That's my first question.

 

Here's the actual question, although it will be very vague now: I have a basic header and footer in Flash that stretch to fill the screen horizontally. It works when I test the file inside Flash (Control>Test movie). But it does not work when I go "Publish Preview" and use the browser. Why is that and how can I sort it out? Any ideas?

 
Replies
  • Currently Being Moderated
    Jan 16, 2013 12:20 PM   in reply to CarolWasp

    No, you cannot attach files in these forums.  Also, few people will download files for a variety of good reasons.

     

    If you are previewing in a browser, then it is likely that an html page is being generated for the preview, and that html page is probably sizing the flash content per the stage dimensions the pieces were designed with.

     

    What you probably need to do is find a tutorial for creating full screen content, though you could probably find a solution if you search tis forum as well.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 17, 2013 3:35 AM   in reply to CarolWasp

    Flash Fluid Layout is the magic word.

    Check this out.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 17, 2013 3:09 PM   in reply to CarolWasp

    In my case I've got a bunch of buttons (and some other stuff) that will obviously cease to work as buttons once I turn them into a movieclip.

     

    Nobody said you had to turn your buttons into MovieClips.

    Buttons will just work fine inside a MovieClip.

     

    SimpleButtonsInsideMovieClipJPG.JPG

    Nested inside the Blue MovieClip are two SimpleButtons that work as expected, they have not been converted to MovieClips, all their up, over and whatnot states are intact.

     

    import flash.events.MouseEvent;

     

    mc.mouseEnabled = false;

    mc.button1.addEventListener(MouseEvent.CLICK, clickHandler);

    mc.button2.addEventListener(MouseEvent.CLICK, clickHandler);

     

    function clickHandler(e:MouseEvent):void{

        trace(e.currentTarget.name);

    }

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 19, 2013 3:48 AM   in reply to CarolWasp

    Simply add the Loader to a newly created MovieClip:

     

    var mc:MovieClip = new MovieClip();

    addChild( mc);

     

    var ExitLoader:Loader = new Loader();

     

    //its important to wait for the swf to be fully loaded

    ExitLoader.contentLoaderInfo.addEventListener(Event.COMPLETE , completeHandler );

    ExitLoader.load(new URLRequest("Exit.swf"));

     

    function completeHandler( event:Event ):void

    {

        mc.addChild( ExitLoader);

    }

     

    once inside the mc, you can manipulate the Exit.swf x/y-Positions with

    mc.x=154;

    mc.y=127;

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 19, 2013 7:55 AM   in reply to CarolWasp

    This code should throw an error;

    Enable debugging and look at the Output window;

     

    MovieClip needs the new Constructor:

    var content:MovieClip= new MovieClip();

    addChild(content);

     

    Btw my mc is named "content". Probably a bad name since it tends to turn blue. I don't know.

    You are right, its a bad name, it works in this context, but it makes the code less readable.

    Its generally a good idea to avoid any reserved Keywords in any programming language.

     

    so its definitively better to name that MovieClip _content or content_

     

    It`s probably a good thing that you make an empty fla and compile that code to see what really happens, when you place an empty MoviClip on the stage:

     

    var _content:MovieClip = new MovieClip();

     

    addChild(_content);

     

    trace(_content.x);

    trace(_content.y);

    trace(_content.width);

    trace(_content.height);

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 20, 2013 11:36 PM   in reply to CarolWasp

    You could put all the content of your Scenes in one MovieClip.

    So you would have a Scene1, Scene2 Movieclip etc. and then you would have to declare all the vars and functions in it private, so you could reuse your code.

    Or you could split up your scenes in different flas and load them via a Main.as.

     

    But I would strongly advise against such a thing.

     

    Here is a good read that explains how to do navigation properly in AS3.

    After that you will maybe get new Ideas how to restructure your work, to make it easier to maintain.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 22, 2013 12:34 AM   in reply to CarolWasp

    The error you are receiving is one of the most common.

    Read this, to get more insight.

     

    var header:MovieClip; = new MovieClip();

    This line of code can never work. It should be

     

    var header:MovieClip =  new MovieClip();

     


     
    |
    Mark as:
  • Currently Being Moderated
    Jan 23, 2013 2:37 AM   in reply to CarolWasp

    Define ugly.

    Does the content look pixelated, distorted or blurry after you resize?

    The demo you mention looks perfectly fine for me.

     

    If you rightclick on the demo, check if the quality of your flashplayer is set to high.

    The local Flash Player settings will alway "override" your Publishing settings. Even if you publish your content to 100% and deactivate compressed: if the user chooses low quality it will always look ugly.

     

    As for the Reuters site you showed as a superior example: it uses no Flash to resize its Layout but purely css/javascript.

     

    What's the secret? Any keywords? What should I look for?

    You are probably looking for Pixel Perfect Fluid Layouts

     

    Other tips: If you have any bitmaps on your stage that have bitmapSmoothing set to true, any scaling (that you might do during rezizing, or rotation will require you to set the property again. The bitmap.Smoothing property gets "Lost in Transformation" so to speak.)

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points