A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Problem passing from HTML to Flash

  1. #1
    Media Developer CJElven's Avatar
    Join Date
    Jan 2002
    Location
    San Antonio, TX
    Posts
    298

    Problem passing from HTML to Flash

    I've read posts on how to do it. I've read posts on how to do it differently than the first posts. But I can't get it to work! This is obviously a big problem!

    What am I talking about? Passing info from my HTML page to my Flash movie, of course!

    Here is the entirety of the HTML page that was exported from Flash (CS3) when I published:
    Code:
    <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>test1</title>
    <script language="javascript">AC_FL_RunContent = 0;</script>
    <script src="AC_RunActiveContent.js" language="javascript"></script>
    </head>
    <body bgcolor="#ffffff">
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <!--
    <p align="left"></p>
    -->
    <!-- saved from url=(0013)about:internet -->
    <script language="javascript">
    	if (AC_FL_RunContent == 0) {
    		alert("This page requires AC_RunActiveContent.js.");
    	} else {
    		AC_FL_RunContent(
    			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
    			'width', '550',
    			'height', '400',
    			'src', 'test1',
    			'quality', 'high',
    			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
    			'align', 'middle',
    			'play', 'true',
    			'loop', 'true',
    			'scale', 'showall',
    			'wmode', 'window',
    			'devicefont', 'false',
    			'id', 'test1',
    			'bgcolor', '#ffffff',
    			'name', 'test1',
    			'menu', 'true',
    			'allowFullScreen', 'false',
    			'allowScriptAccess','sameDomain',
    			'movie', 'test1',
    			'salign', ''
    			); //end AC code
    	}
    </script>
    <noscript>
    	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="550" height="400" id="test1" align="middle">
    	<param name="allowScriptAccess" value="sameDomain" />
    	<param name="allowFullScreen" value="false" />
    	<param name="movie" value="test1.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed src="test1.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="test1" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    	</object>
    </noscript>
    </body>
    </html>
    If I make the changes here:
    Code:
    <param name="movie" value="test1.swf?text=hello" /><
    ...and here:
    Code:
    <embed src="test1.swf?text=hello" quality="high"
    ...my movieClip (which contains nothing but a dynamic TextField with the variable name of "text") does nothing. It returns nothing, shows nothing...NOTHING!

    I've even tried passing JavaScript functions (also mentioned elsewhere) but can't get that to work, either.

    Now, the only thing that I can see, is that none of the tutorials I've found so far mention the first portion of the HTML page, namely the portion between <script language="javascript"> and </script>. Is this the all important piece that I'm missing?

    If I just cut the HTML down to only the older <object classid> portion, NOTHING happens. No, that's not quite true. What happens is that the movie is put on the webpage as nothing useful. It's smaller, and doesn't even show the simple onscreen elements that I had placed there earlier (a simple border around the TextField).

    Does anyone know what the heck is going on?

    BTW, the older version of a flash instance on an HTML page seems to work just fine in Firefox, but not IE 6 or 7. I am also running this from my local computer, if that might make a difference.

    Thanks for any help that anyone can give me.
    Dragontech Media
    Magic.Fire.Content

  2. #2
    OOP is one letter from OOPS kortex's Avatar
    Join Date
    Aug 2005
    Location
    New Hope, PA
    Posts
    2,668
    This portion that you have modified only gets runn if the user does not have javascript

    <noscript>
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="550" height="400" id="test1" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="allowFullScreen" value="false" />
    <param name="movie" value="test1.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /> <embed src="test1.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="test1" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    </noscript>

    Since this variables are not set in the AC_FL_RunContent script, they are not being passed.


    Try

    adbe_paul said on Nov 15, 2007 at 2:01 PM :

    @ No screen name:

    If you want to use FlashVars in conjunction with the RunActiveContent scripts, you need to add an additional name/value pair into the code that calls the AC_FL_RunContent() function.

    If you look at the source you'll see it calls AC_FL_RunContent() and inside the parentheses there's a big list of pairs of values. Just add 'flashvars', 'var1=value&var2=value2', into that list (it doesn't matter where) and it will add the url variables into the script-generated <object> and <embed> tags.

    From (in comments) : http://livedocs.adobe.com/flash/9.0/...=00000667.html
    Last edited by kortex; 01-07-2008 at 05:23 PM.
    Jeremy Wischusen
    Flash - Flex - LAMP - Web Developer Purple Inc
    AS OOP FAQ-Best Practices Thread | Flashkit OOP Tutorials | Purple Inc (day job) | Blog


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