3 Replies Latest reply on Nov 7, 2009 12:50 AM by Saransoft84

    Show image using FlashVars

    ZeeshanHashmi

      Hello

       

      I am a newbie in the World of Flash !

       

      I have a task where a user fills in a form and uploads a photo. As a result a HTML page is generated that pass the form data to SWF file using FlashVars.

       

      What i want is that the SWF movie loads the uploaded image and show that at frame no. 400 till 1000

       

      I want to know what steps I have to take and what Code i have to write in order to achieve what I want.

       

      Please guide me !

       

       

      Thanks

      Zeeshan

        • 1. Re: Show image using FlashVars
          Saransoft84

          Hi,

           

          If you are using AS2.0

           

          createEmptyMovieClip("image",this.getNextHighestDepth());

           

          image.loadMovie(imgname);

           

           

          If it is AS3.0

           

          import flash.display.MovieClip;

           

          var image:MovieClip = new MovieClip();

          addChild(image);

           

           

          var pictLdr:Loader = new Loader();

          var pictURL:String = root.loaderInfo.parameters.imgname;

          var pictURLReq:URLRequest = new URLRequest(pictURL);

          pictLdr.load(pictURLReq);

          image.addChild(pictLdr);

           

           

          The Html page contain

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

          <head>

          <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"

           

          />

          <title>test</title>

           

          </head>

          <body bgcolor="#ffffff">

          <embed src="test.swf" flashvars="imgname=2b.jpg" quality="high"

           

          bgcolor="#ffffff" width="550" height="400" name="test" align="middle"

           

          allowScriptAccess="sameDomain" allowFullScreen="false"

           

          type="application/x-shockwave-flash"

           

          pluginspage="http://www.macromedia.com/go/getflashplayer" />

           

          </body>

          </html>

           

           

          the red color coding is used for the flashvars and the "imgname".

           

          Saransoft

          • 2. Re: Show image using FlashVars
            ZeeshanHashmi Level 1

            Hi

             

            Thanks for your reply !

             

            I am too dumb, i want to know what I have to put (layers, movie clips etc) in Flash in order to make your code working.

             

            I want the image to be shown from Frame No. 400 to 1000

             

            So how many layers / objects I would need ?

            • 3. Re: Show image using FlashVars
              Saransoft84 Level 3

              Hi

               

              create a empty movieclip and place in your desired layer (ie 400 or 250).

               

              name the movieclip and  place the coding on that layer.

               

              Saransoft