# Passing variables in embed code

**URL:** <https://forum.kirupa.com/t/passing-variables-in-embed-code/319995>\
**Category:** flash\
**Created:** [March 10, 2011, 7:09pm UTC](https://forum.kirupa.com/t/passing-variables-in-embed-code/319995 "2011-03-10T19:09:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![basscadet](https://avatars.discourse-cdn.com/v4/letter/b/ecae2f/32.png) [@basscadet](https://forum.kirupa.com/u/basscadet)\
**Post date:** [March 10, 2011, 7:09pm UTC](https://forum.kirupa.com/t/passing-variables-in-embed-code/319995/1 "2011-03-10T19:09:21Z")

</div>

Hi all,  
what I need to do is have a flash movie jump to a set label in timeline according to which named variable I have defined in the embed HTML code.

So, let’s say I have a movie with two labeled frames (“shape1” and “shape2”) and when the variable \*\*pagevar \*\*equals “one”, the movie jumps to “shape1” while when the variable \*\*pagevar \*\*equals “two”, the movie jumps to “shape2”. If the variable is undefined or equals anything else, the movie simply stops. Here’s the code in frame one:

```auto
if (pagevar == "one") {
    gotoAndStop("shape1");
} else if (pagevar == "two") {
    gotoAndStop("shape2");
} else {
    stop();
} 

```

now, when I directly call the .swf appending **?pagevar=one** to the URL

file:///C:/vartest/vartest.swf?pagevar=one

then the movie responds fine.

But when I try to add this variable inside the embed tag in an HTML file

```auto
<OBJECT CLASSID="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" CODEBASE=".../swflash.cab#version=10,0,0,0" WIDTH="200" HEIGHT="200" ID="vartest" ALIGN="middle">
    <PARAM NAME="allowScriptAccess" VALUE="sameDomain" />
    <PARAM NAME="allowFullScreen" VALUE="false" />
    <PARAM NAME="movie" VALUE="vartest.swf?pagevar=two" /><PARAM NAME="quality" VALUE="autohigh" /><PARAM NAME="wmode" VALUE="opaque" /><PARAM NAME="bgcolor" VALUE="#ffffff" /><EMBED SRC="vartest.swf?pagevar=two" WIDTH="200" HEIGHT="200" ALIGN="middle" QUALITY="autohigh" WMODE="opaque" BGCOLOR="#ffffff" NAME="vartest" ALLOWSCRIPTACCESS="sameDomain" ALLOWFULLSCREEN="false" TYPE="application/x-shockwave-flash" />
    </OBJECT> 

```

it does not work and stays at first frame. What am I doing wrong??? I have attached test fla+swf+html (Flash CS4)
