1 Reply Latest reply: Apr 17, 2012 8:39 PM by adninjastrator RSS

    How to Make Flash CS4/Dreamweaver CS4 Website Function on all Latest Mobile Devices

    suzaustralia Community Member

      Hello!

      I am trying to add code into my Dreamweaver CS4 file and/or Flash CS4 file in order to have the website I have created work across all of the latest mobile devices as well as traditional online systems. My flash file has a transparent stage, and my dreamweaver file has a full-screen background image. I have reviewed various tutorials and articles available online, and some advocate simply adding code, which does not seem to be working for me, while others suggest having a similar separate site created solely for mobile devices. If this is the best option, I don't know how that should be set up. What is the best path to take with this?

       

      This is the collection of various pieces of code I have tried adding to my files:

       

        <meta name="viewport" content="width=device-width" user-scalable="yes" initial-scale="1.0" /> <!-- iphone,android -->

         <meta name="HandheldFriendly" content="true" /> <!-- blackberry -->

      </style>

      _______

       

         <param name="allowScriptAccess" value="sameDomain" />

            <param name="allowFullScreen" value="true" />

      _______

       

      <param name="allowScriptAccess" value="sameDomain" />

              <param name="allowFullScreen" value="true" />

              <param name="var params = {          id: "flashID", name: "flashcontent", menu: "false", allowFullScreen: "true", fullScreenOnSelection: "true", scale:"noscale", salign:"middle"};"

      ______

       

      stage.scaleMode = StageScaleMode.NO_SCALE;

      stage.align = StageAlign.TOP_LEFT;

       

      //or//

       

      this.stage.scaleMode = StageScaleMode.NO_SCALE;

      this.stage.align = StageAlign.TOP_LEFT;

      _____

       

      next_btn.width = 133 * .5;

      next_btn.height = 133 * .5;

      _____

      //flash//

      next_btn.width = Capabilities.screenDPI * .5;

      next_btn.height = Capabilities.screenDPI * .5;

       

      //flash//

       

      this.stage.addEventListener(Event.RESIZE, doLayout);

       

      //flash://

       

      <initialWindow>

         <width>320</width>

         <height>480</height>

         <!-- several other properties... -->

      </initialWindow>

      -----

       

      /**

      * Convert inches to pixels.

      */

      private function inchesToPixels(inches:Number):uint

      {

         return Math.round(Capabilities.screenDPI * inches);

      }

      -----

       

      var button:Sprite = new Sprite();

      button.x = 20;

      button.y = 20;

      button.graphics.beginFill(0x 003037);

      button.graphics.drawRect(0, 0, this.inchesToPixels(.75),

         this.inchesToPixels(.25));

      button.graphics.endFill();

         this.addChild(button);

      ______

       

      //hard-code title://

       

      var titleBar:Sprite = new Sprite();

      titleBar.x = 0;

      titleBar.y = 0;

      _______

      //stage width determines width of title://

       

      var titleBar:Sprite = new Sprite();

      titleBar.x = 0;

      titleBar.y = 0;

      titleBar.graphics.beginFill(0x003037);

      titleBar.graphics.drawRect(0, 0, this.stage.stageWidth,

         this.inchesToPixels(.3));

      titleBar.graphics.endFill();

      this.addChild(titleBar);

      ______

      //footer://

      var footer:Sprite = new Sprite();

      footer.graphics.beginFill(0x003037);

      footer.graphics.drawRect(0, 0, this.stage.stageWidth,

         this.inchesToPixels(.3));

      footer.graphics.endFill();

      footer.x = 0;

      footer.y = this.stage.stageHeight - footer.height;

      this.addChild(footer);

      _____

      /**

      * Center one DisplayObject relative to another.

      */

      private function center(foreground:DisplayObject,

         background:DisplayObject):void

         {

            foreground.x = (background.width / 2) -

               (foreground.width / 2);

            foreground.y = (background.height / 2) +

               (foreground.height / 2);

         }

      _______

      //cont.//

      var title:SimpleLabel = new SimpleLabel("My Application",

         "bold", 0xffffff, "_sans", this.inchesToPixels(.15));

      this.center(title, titleBar);

      this.addChild(title);

      _______

      //override width and height getters

      public override function get width():Number

      {

         return this.textLine.textWidth;

      }

       

      public override function get height():Number

      {

         return (this.textLine.ascent - 1);

      }

      _____

       

      if (Capabilities.manufacturer == "Android Linux" && Capabilities.screenResolutionY == 1024)

      {

      next_btn.width = 85;

      next_btn.height = 85;

      }

       

       

      This is the code for my Dreamweaver CS4 file (without the additional erogenous code attempts!):

       

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <html xmlns="http://www.w3.org/1999/xhtml">

      <?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN"

      <head>

      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

      <title>My Website Title and Slogan.</title>

      <style type="text/css">

      <!--

      body {

                background-image: url(bground%20_img3.jpg);

                background-repeat: no-repeat;

      }

      -->

      <script src="Scripts/swfobject_modified.js" type="text/javascript"></script>

      </head>

       

      <body>

      <img src ="image.gif"  width=90% height=auto>

      <script src="Scripts/swfobject_modified.js" type="text/javascript"></script>

      <meta name="Keywords" content="keywords…" />

      <div align="center"></div>

      <div align="center">

        <p> </p>

        <p>

          <object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="900" height="630">

            <param name="movie" value="FlashFile.swf" />

            <param name="quality" value="high" />

            <param name="wmode" value="transparent" />

            <param name="swfversion" value="6.0.65.0" />

            <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->

            <param name="expressinstall" value="Scripts/expressInstall.swf" />

            <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->

            <!--[if !IE]>-->

            <object type="application/x-shockwave-flash" data="FlashFile.swf" width="900" height="630">

              <!--<![endif]-->

              <param name="quality" value="high" />

              <param name="wmode" value="transparent" />

              <param name="swfversion" value="6.0.65.0" />

              <param name="expressinstall" value="Scripts/expressInstall.swf" />

              <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->

              <div>

                <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>

                <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>

              </div>

              <!--[if !IE]>-->

            </object>

            <!--<![endif]-->

          </object>

        </p>

      </div>

      <div align="center"> </div>

      <script type="text/javascript">

      <!--

      swfobject.registerObject("FlashID");

      swfobject.registerObject("FlashID");

      //-->

      </script>

      </body>

      </html>

       

       

       

      I have tried various combinations of the code listed above, but nothing seems to be working. I am not sure as to the correct positioning of the code, and maybe that is the problem, or maybe it is because this code in not for CS4, or not appropriate for my project. I also do not know what code should be inside the Flash file, nor what should should be inside the Dreamweaver file.

       

      Thank you in advance for any assistance!