Groups | Blog | Home
all groups > flash actionscript > november 2006 >

flash actionscript : Dynamic data from URL


Gart
11/15/2006 9:28:44 PM
I have a Flash page that allows a user to dynamically select a graphic's mat
colors frame type, and frame color. The graphic is to be loaded from our
ZenCart shopping cart. I can call the Flash page from ZenCart and would like to
just encode the graphic's ID at the end of the URL that calls the Flash page,
like this: http://www.mypage.com?ZC=180. In this example I would parse my XML
DB looking for graphic number 180, display it, and I'm done.

I'm confused (after looking at a gazillion Flash and ActionScript books and
Googling every term I can think of). Should I be using loadVars, FlashVars,
URLLoader or something else? Does anyone have any code snippets I can look at?
I'm spending too much time researching this problem and not enough time solving
it...the client's getting antsy.

Thanks!
cutie369
11/15/2006 9:55:33 PM
Gart, I am going through the same problem. I have a script which sends the
FlashVars dynamically to the object and embed tag however once I get the
FlashVars inside of Flash I am not able to access them.

<script src="js/swfobject.js" type="text/javascript"></script>
<div id="comm" style="margin:0px; padding:0px; text-align:left; width:500px;
height:350px; background-color:#636363;">
[B]You need to upgrade your Flash Player[/B]
<code>noscript</code>
</div>
<script type="text/javascript">
// <![CDATA[

var so = new SWFObject("pflipper.swf", "pflipper", "500", "600", "8.0.23",
"#636363", true);
so.addVariable("myURL",
getQueryParamValue("<cfoutput>#URL.myURL#</cfoutput>"));
so.write("comm");

// ]]>
</script>

Here is my AS.

if (_level0.myURL == undefined) {

}
else {
pflipper.gotoPage(3);
gotoAndStop(1);
}

This absolutely works. However, I am not sure how to test for certain
variables in AS such as
If myURL == 4 do this
pflipper.gotoPage(3);
gotoAndStop(1);

I know that this should be in an if statement but everything I have tried like
this does not work?
AddThis Social Bookmark Button