Flashvars in AS2

So I am really not getting how to use flashvars at all. I
know it must be really simple, but I am just not making the
connection, so I would really appreciate anybody's help.
This is the html for my flash movie:
<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>cameras</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-->
<!-- 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', '800',
'height', '100',
'src', 'cameras',
'quality', 'high',
'pluginspage', '
http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'cameras',
'bgcolor', '#ffffff',
'name', 'cameras',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'cameras',
'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="800" height="100" id="cameras" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="cameras.swf" /><param
name="quality" value="high" /><param name="bgcolor"
value="#ffffff" /> <embed src="cameras.swf" quality="high"
bgcolor="#ffffff" width="800" height="100" name="cameras"
align="middle" allowScriptAccess="sameDomain"
allowFullScreen="false" type="application/x-shockwave-flash"
pluginspage="
http://www.macromedia.com/go/getflashplayer"
/>
</object>
</noscript>
</body>
</html>
Here are the variables I want to change:
vau_nbslots = "Number of products in the banner"
Then for each product, you will have (starting at index 0,
and with 6 products in this case: 0 to 5):
vau_tooltip_0 = "Description of the Product - will be shown
when mouse over"
vau_picture_0 = "http link to the image url"
vau_overlay_0 = "http link to the overlay image url (like a
Free Shipping ribbon for instance) - if empty show nothing"
vau_clicklink_0 = "http link of the new page to open when the
user clicks on the product"
vau_tooltip_5 = "Description of the Product - will be shown
when mouse over"
vau_picture_5 = "http link to the image url"
vau_overlay_5 = "http link to the overlay image url (like a
Free Shipping ribbon for instance) - if empty show nothing"
vau_clicklink_5 = "http link of the new page to open when the
user clicks on the product"
And here is the code (I think):
for (slotIndex = 0; slotIndex <
parseInt(this["vau_nbslots"]); slotIndex++)
pictureUrl = this["vau_picture_" + slotIndex];
tooltipText = this["vau_tooltip_" + slotIndex];
overlayUrl = this["vau_overlay_" + slotIndex];
clickLink = this["vau_clicklink_" + slotIndex];
I suppose my real question is where all this goes and if I
have it right?

Redeclaring the click handler function in each loop through buttons is not necessary, you'd better do it like this, with click handler outside the loop:
for (var i:Number=0; i<11; i++)
    menu_mc["button" +  i].addEventListener(MouseEvent.CLICK, clickHandler);
And the second thing - click handler. For more flashvars (or if you don't know how many flashvars will be used) you can loop throug loaderInfo.parameters object with for-in loop. The problem here is that order in for-in loop is rather random ("not guaranteed" as they nicely call it :-) ), so it complicates assigning the urls to particular buttons. I would connect here name of a flashvar (this declared in HTML) with a button:
function clickHandler(evt:MouseEvent):void
     for (var par:* in loaderInfo.parameters)
         if (evt.target.name == par) // checks if instance name of the clicked button is equal to the current flashvar, here par is NAME of the flashvar, NOT VALUE
               var request:URLRequest = new URLRequest(loaderInfo.parameters[par]); // when the name of flashvar = name of button, the VALUE of this flashvar is retrieved in URLRequest constructor
                 navigateToURL(request,"_blank");

Similar Messages

  • FlashVar to as2 loaded into as3

    I am afraid I already know the answer to my question but I am
    hoping otherwise. Previously an AS2 movie loaded into an AS2 movie
    could get flashvar values through _level0 or _root. My problem is
    having an AS2 movie loaded into an AS3 movie and still letting the
    loaded AS2 have access to the flashvars. I can successfully get the
    flashvars into the AS3 movie so that isn't an issue. I searched
    around and couldn't find any posts that helped and if this has
    already been covered I would appreciate a point in the right
    direction.

    First off thank you for your replies, links and help.
    So my fears were correct, there is no easy solution. I was
    hoping that I could use loader variables to load flashvars to the
    loaded clip or something where I could still have the as2 continue
    to use _level0. The reason for keeping _level0 is the classic "I
    don't want to rewrite everything."
    Thanks again.

  • Load AS2 SWF in AS3 SWF with FlashVars

    I am able to load SWF which is created using AS2 in to AS3
    SWF but I am not able to pass Flashvars to it..
    Does any one has any idea, how can I do that??
    Thanks

    You can talk to loaded AVM1 (AS1/2) SWF using LocalConnection. I used Grant Skinner's SWFBridge class in the past and worked very well:
    http://gskinner.com/blog/archives/2007/07/swfbridge_easie.html
    Kenneth Kawamoto
    http://www.materiaprima.co.uk/

  • Help Converting old AS2 code to AS3

    I just updated an old flash file with some new photos.  I don't know much about Flash - enough to change the photos and hit export BUT now I'm getting errors.  I had a _root issue which I fixed thanks to this forum but I'm still getting these errors:
    Scene 1, Layer 'Actions', Frame 3, Line 14, Column 2
    1120: Access of undefined property timer1.
    Scene 1, Layer 'Actions', Frame 3, Line 18, Column 2
    1120: Access of undefined property i.
    Scene 1, Layer 'Actions', Frame 3, Line 29, Column 2
    1120: Access of undefined property timer2.
    Scene 1, Layer 'Actions', Frame 3, Line 33, Column 35
    1120: Access of undefined property i.
    Scene 1, Layer 'Actions', Frame 3, Line 34, Column 5
    1120: Access of undefined property i.
    Scene 1, Layer 'Actions', Frame 3, Line 35, Column 17
    1120: Access of undefined property timer2.
    Scene 1, Layer 'Actions', Frame 3, Line 40, Column 2
    1120: Access of undefined property i.
    Scene 1, Layer 'Actions', Frame 3, Line 40, Column 6
    1120: Access of undefined property i.
    Scene 1, Layer 'Actions', Frame 3, Line 44, Column 16
    1120: Access of undefined property timer1.
    Preloader, Layer 'Actions', Frame 1, Line 1, Column 1
    1120: Access of undefined property bytes_loaded.
    Preloader, Layer 'Actions', Frame 1, Line 2, Column 1
    1120: Access of undefined property bytes_total.
    Preloader, Layer 'Actions', Frame 1, Line 3, Column 1
    1120: Access of undefined property getPercent.
    Preloader, Layer 'Actions', Frame 1, Line 3, Column 14
    1120: Access of undefined property bytes_loaded.
    Preloader, Layer 'Actions', Frame 1, Line 3, Column 27
    1120: Access of undefined property bytes_total.
    Preloader, Layer 'Actions', Frame 1, Line 4, Column 25
    1120: Access of undefined property getPercent.
    Preloader, Layer 'Actions', Frame 1, Line 5, Column 30
    1120: Access of undefined property getPercent.
    Preloader, Layer 'Actions', Frame 1, Line 7, Column 5
    1120: Access of undefined property bytes_loaded.
    Preloader, Layer 'Actions', Frame 1, Line 7, Column 21
    1120: Access of undefined property bytes_total.
    Preloader, Layer 'Actions', Frame 1, Line 8, Column 24
    1067: Implicit coercion of a value of type int to an unrelated type String.
    I didn't originally write the code and I don't know nearly enough about Flash to fix them.  Here's the code:
    stop();
    var fadeSpeed = 40; //Sets fad-in speed of images, default is 30
    var imageTime = 5; //Sets time each image is on screen, in seconds
    MovieClip(root).attachMovie("mc_Images", "mcFader", 10, {x:0, y:0});
    MovieClip(root).mcFader._alpha = 0;
    MovieClip(root).mcFader._visible = false;
    var imageNum = 1;
    startShow();
    function startShow(){
              timer1 = setInterval(loadImage, imageTime * 1000);
    function loadImage(){
              i = 0;
              imageNum ++;
              if(imageNum == MovieClip(root).mcImages._totalFrames + 1){
                        imageNum = 1;
              MovieClip(root).mcImages._x = 0;
              MovieClip(root).mcImages._y = 0;
              MovieClip(root).mcFader._alpha = 0;
              MovieClip(root).mcFader._visible = true;
              MovieClip(root).mcFader.gotoAndStop(imageNum);
              MovieClip(root).nextImage = imageNum;
              timer2 = setInterval(fadeImage, fadeSpeed);
    function fadeImage(){
              MovieClip(root).mcFader._alpha = i;
              if(i > 100){
                        clearInterval(timer2);
                        MovieClip(root).mcImages.gotoAndStop(MovieClip(root).nextImage);
                        MovieClip(root).mcFader._alpha = 0;
                        MovieClip(root).mcFader._visible = false;
              i = i + 10;
    function goLink(fNum){
              clearInterval(timer1);
              MovieClip(root).mcImages.gotoAndStop(fNum);
    ANY help would be GREATLY appreciated!! 

    Ok, I researched a little.
    The variable i is set to 0 in loadImage, which is called by a timed out function startShow, which is called directly.
    So I was right to surmise I=0, but you don't even need to define it yet.
    If you add
    var i;
    var timer1,timer2;
    to the top of the program, all the variables are defined globally, which as far as I can see is the intention.
    That leaves me with one undefined variable and curious syntax:
    r36:
    this.mcImages.gotoAndStop(this.nextImg age);
    What is intended here? Age is never defined. I guess it might be defined by Flashvars, as in as2, these would be accesible as a root variable, but this doesn't mean much to me. I'd expect something like this.nextImg+age or something.
    So I searched again: nextImg is not defined but I found this.nextImage = imageNum;
    So there is just a space that got in there somehow.
    Fixed that and it compiles, but immeadeately after compilation you get a problem with attachMovie
    this.attachMovie("mc_Images", "mcFader", 10, {x:0, y:0});
    This is a as2 way of taking things out of your library and placing them as a child of another.
    The new way to do that is to make a clip accessible in your library and then instantiate a new class with:
    var mcFader:mc_Images= new mc_Images();
    this.setChildIndex(mcFader,10);
    mcFader.x=0; // this is not needed, as it is default, as it was in as2, so it was obsolete there as well!
    mcFader.y=0;// this is not needed, as it is default, as it was in as2, so it was obsolete there as well!
    this.addChild(mcFader);
    There are some other issues after that,
    I would have to look at the source to fix them, because they have to do with the structure of mc_images. Which is not in code, but in your library.
    The whole code would the look like this:
    stop();
    var fadeSpeed = 40; //Sets fad-in speed of images, default is 30
    var imageTime = 5; //Sets time each image is on screen, in seconds
    var mcFader:mc_Images= new mc_Images();
    this.setChildIndex(mcFader,10);
    mcFader.x=0; // this is not needed, as it is default, as it was in as2, so it was obsolete there as well!
    mcFader.y=0;// this is not needed, as it is default, as it was in as2, so it was obsolete there as well!
    this.addChild(mcFader);
    this.mcFader._alpha = 0;
    this.mcFader._visible = false;
    var imageNum = 1;
    var i=0;
    var timer1,timer2;
    startShow();
    function startShow(){
             timer1 = setInterval(loadImage, imageTime * 1000);
    function loadImage(){
              i = 0;
              imageNum ++;
              if(imageNum == this.mcImages._totalFrames + 1){
                        imageNum = 1;
              this.mcImages._x = 0;
              this.mcImages._y = 0;
              this.mcFader._alpha = 0;
              this.mcFader._visible = true;
              this.mcFader.gotoAndStop(imageNum);
              this.nextImage = imageNum;
              var timer2 = setInterval(fadeImage, fadeSpeed);
    function fadeImage(){
              this.mcFader._alpha = i;
              if(i > 100){
                        clearInterval(timer2);
                        this.mcImages.gotoAndStop(this.nextImgage);
                        this.mcFader._alpha = 0;
                        this.mcFader._visible = false;
              i = i + 10;
    function goLink(fNum){
              clearInterval(timer1);
              this.mcImages.gotoAndStop(fNum);
    jencreates wrote:
    I just updated an old flash file with some new photos.  I don't know much about Flash - enough to change the photos and hit export BUT now I'm getting errors.  I had a _root issue which I fixed thanks to this forum but I'm still getting these errors:
    Scene 1, Layer 'Actions', Frame 3, Line 14, Column 2
    1120: Access of undefined property timer1.
    Scene 1, Layer 'Actions', Frame 3, Line 18, Column 2
    1120: Access of undefined property i.
    Scene 1, Layer 'Actions', Frame 3, Line 29, Column 2
    1120: Access of undefined property timer2.
    Scene 1, Layer 'Actions', Frame 3, Line 33, Column 35
    1120: Access of undefined property i.
    Scene 1, Layer 'Actions', Frame 3, Line 34, Column 5
    1120: Access of undefined property i.
    Scene 1, Layer 'Actions', Frame 3, Line 35, Column 17
    1120: Access of undefined property timer2.
    Scene 1, Layer 'Actions', Frame 3, Line 40, Column 2
    1120: Access of undefined property i.
    Scene 1, Layer 'Actions', Frame 3, Line 40, Column 6
    1120: Access of undefined property i.
    Scene 1, Layer 'Actions', Frame 3, Line 44, Column 16
    1120: Access of undefined property timer1.
    Preloader, Layer 'Actions', Frame 1, Line 1, Column 1
    1120: Access of undefined property bytes_loaded.
    Preloader, Layer 'Actions', Frame 1, Line 2, Column 1
    1120: Access of undefined property bytes_total.
    Preloader, Layer 'Actions', Frame 1, Line 3, Column 1
    1120: Access of undefined property getPercent.
    Preloader, Layer 'Actions', Frame 1, Line 3, Column 14
    1120: Access of undefined property bytes_loaded.
    Preloader, Layer 'Actions', Frame 1, Line 3, Column 27
    1120: Access of undefined property bytes_total.
    Preloader, Layer 'Actions', Frame 1, Line 4, Column 25
    1120: Access of undefined property getPercent.
    Preloader, Layer 'Actions', Frame 1, Line 5, Column 30
    1120: Access of undefined property getPercent.
    Preloader, Layer 'Actions', Frame 1, Line 7, Column 5
    1120: Access of undefined property bytes_loaded.
    Preloader, Layer 'Actions', Frame 1, Line 7, Column 21
    1120: Access of undefined property bytes_total.
    Preloader, Layer 'Actions', Frame 1, Line 8, Column 24
    1067: Implicit coercion of a value of type int to an unrelated type String.
    I didn't originally write the code and I don't know nearly enough about Flash to fix them.  Here's the code:
    stop();
    var fadeSpeed = 40; //Sets fad-in speed of images, default is 30
    var imageTime = 5; //Sets time each image is on screen, in seconds
    MovieClip(root).attachMovie("mc_Images", "mcFader", 10, {x:0, y:0});
    MovieClip(root).mcFader._alpha = 0;
    MovieClip(root).mcFader._visible = false;
    var imageNum = 1;
    startShow();
    function startShow(){
              timer1 = setInterval(loadImage, imageTime * 1000);
    function loadImage(){
              i = 0;
              imageNum ++;
              if(imageNum == MovieClip(root).mcImages._totalFrames + 1){
                        imageNum = 1;
              MovieClip(root).mcImages._x = 0;
              MovieClip(root).mcImages._y = 0;
              MovieClip(root).mcFader._alpha = 0;
              MovieClip(root).mcFader._visible = true;
              MovieClip(root).mcFader.gotoAndStop(imageNum);
              MovieClip(root).nextImage = imageNum;
              timer2 = setInterval(fadeImage, fadeSpeed);
    function fadeImage(){
              MovieClip(root).mcFader._alpha = i;
              if(i > 100){
                        clearInterval(timer2);
                        MovieClip(root).mcImages.gotoAndStop(MovieClip(root).nextIm age);
                        MovieClip(root).mcFader._alpha = 0;
                        MovieClip(root).mcFader._visible = false;
              i = i + 10;
    function goLink(fNum){
              clearInterval(timer1);
              MovieClip(root).mcImages.gotoAndStop(fNum);
    ANY help would be GREATLY appreciated!! 

  • Setting flashvars in AS3 when testing movie

    Does anyone know how to set flashvars when running a movie in CS4 using Control->Test Movie?  Under ActionScript 2 I could just set _root.flashVar, what's the equivalent in AS3?

    Hi Dan,
    Thanks, but I'm not quite understanding what this solution is.  Is the AS2 that you're thinking in terms of when you're posting this solution?
    In AS3, the flashvar parameters don't appear as top level properties, they are found under "root.loaderInfo.parameters".  So I can look up a parameter like this:
    trace("myVar=" + root.loaderInfo.parameters.myVar);
    I'd like to be able to do something like setting this parameter in my test code like this:
    root.loaderInfo.parameters.myVar="test value";
    ...but this doesn't seem to work.  No error message when I try this (either running "Test Movie" in CS4 or running in Flash Player in FireFox).  Looking at the doc page for flash.display.LoaderInfo, it says that the "parameters" property is readonly.
    I wish there were some kind of dialog in CS4 to allow me to set up flash vars for testing under Control->Test Movie, but if there is such a thing, I haven't found it yet!
    - Bruce

  • DMP 4310 load swf with flashvars

    Hi,
    I am using dmp 4310 and i want to load a swf file using flashvars. This swf is loaded through another swf (a wrapper swf) with the "MovieClip Loader Object" (AS2). When i load the swf using http request i do not have any prblems (eg clipLoader.loadMovie("http://10.0.0.1/swfTest.swf?flashVar1=test1")). The problem is that i cannot get the flashvars by loading the same swf file locally (eg clipLoader.loadMovie("file:///tmp/ftproot/usb_1/files/swfTest.swf?flashVar1=test1")). Is there any way to get the flashvar? Also, is there any way to access the swf file (with the flashvars) using the internal http service (eg http://localhost/...swfTest.swf?flasvar1=test1  -- where localhost is the player itself).
    Thank you in advance for your response!

    Suddenly that code in the following gives me some error
    var langPath = root.LoaderInfo.parameters["xmlFilePath"]+root.LoaderInfo.parameters["lang"];
    my_ssp.xmlFilePath = langPath;
    var fileType = root.LoaderInfo.parameters["xmlFileType"];
    my_ssp.xmlFileType = fileType;
    Access of possibly undefined property LoaderInfo through a reference with static type flash.display:DisplayObject.
    The only code snippet works is
    var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
    for (var param in paramObj) {
       if (param == "xmlFilePath") {
          my_ssp.xmlFilePath = paramObj[param];
       if (param == "xmlFileType") {
          my_ssp.xmlFileType = paramObj[param];

  • FlashVars into AS3 Project.....!!?

    I am working in AS3, I know what needs to be done in AS2. I am needing to pass the FlashVars value to my swf. the FlashVars variable statement for this example is hard coded, but is actually dynamic data being passed from CF. So, to simplify this, I hard coded the FlashVars variable.
    So, I am having trouble passing the FlashVars variable in the following code to the AS3 coding below. Instead of "data/cgal.xml", I need it to pass the variable and dynamically read "http://www.stuartsandlin.com/adirectory/anxmlfile.xml".
    I'm sure can't be that much different from AS2.
    <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="100%" height="100%" id="main" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="allowFullScreen" value="true" />
    <param name="movie" value="main.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" />
    <param name="FlashVars" value="http://www.stuartsandlin.com/adirectory/anxmlfile.xml" />
    <embed src="main.swf" quality="high" bgcolor="#000000" width="100%" height="100%" name="main" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    var loaderXML:URLLoader = new URLLoader();
    LoaderXML.load(NewURLRequest("data/cgal.xml"));

    actually you need to fix your html:
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve rsion=9,0,0,0" width="100%" height="100%" id="main" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="allowFullScreen" value="true" />
    <param  name="movie" value="main.swf" /><param name="quality"  value="high" /><param name="bgcolor" value="#000000" />
    <param name="FlashVars" value="xmlVar=http://www.stuartsandlin.com/adirectory/anxmlfile.xml" />
    <embed src="main.swf" FlashVars="xmlVar=http://www.stuartsandlin.com/adirectory/anxmlfile.xml"  quality="high" bgcolor="#000000" width="100%" height="100%" name="main"  align="middle" allowScriptAccess="sameDomain" allowFullScreen="true"  type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    and that actionscript:
    var loaderXML:URLLoader = new URLLoader();
    LoaderXML.load(NewURLRequest(LoaderInfo(loaderInfo).parameters["xmlVar"]));
    and if you're using a tlf textfield that's loaded you may need an additional step.

  • FlashVars not working in AS3

    Hi,
    I've spent hours trying to get communications with my SWF files to work. At least to get data into my Flash movie, I learned that I'm supposed to use FlashVars (even though I don't like this method because it seems unsecure).
    Anyways - all the examles (eg. here and here) work fine when I download them, but if I create my own file, I get the error:
    1120: Access of undefined property ...
    It took me a while, but I found out that all of these examples use either AS1 or AS2 and indeed, when I switch the project to AS3, it stops working.
    So my question is:
    What do I need to do with CS4 to get this to work? Do I have to import something?
    Thank you in advance for your help!

    @Ned: Thank you! While I did extensive Google searches, I omitted to include AS3 as a keyword. Anyway, this is the piece of code I'm using now:
    var keystr:String;
    var valstr:String;
    var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
    for (keystr in paramObj)
         valstr = String(paramObj[keystr]);
         this.text1.text = "Your IP sent in from PHP is: " + valstr; 
    @Dexterous: Thanks, that would have been much easier and better suited in my case, but sadly it does not work for me (same problem as many of the tutorials on the net:
    TypeError: Error #2007: Parameter text must be non-null.
        at flash.text::TextField/set text()
        at flashvars2_fla::MainTimeline/frame1()
    Not sure what the problem is, I sure would be interested in that kind of approach.
    Thanks again, guys!

  • FlashVars, XML

    Im new to placing external data into Flash. I just got CS3
    and Im trying to use Flash to dynamically load XML data via a
    FlashVars call in the HTML.
    The problem is I have followed the very straight forward AS2
    Help files for using FlashVars and URL variables. I have placed the
    code directly from the Help file into the Html between
    <noscript> <noscript>and i keep getting undefined. I
    have tried saving the file as flash 8 and i am publish flash 8. I
    have no idea why this simple tutorial isnt working! Please help and
    thanks in advance!!!!
    I feel like such a noob.

    Help?
    It seem like the FlashVars doesnt want to work? Any
    reasons?

  • AS3 Flashvars and getURL urgent help

    I have never used flashVars, even in AS2, but the project I'm working on  requires that I use since my client is going to use dynamic urls  defined as expressions and he wants to have control without having to  edit a fla file. I have read a lot of tutorials and can't seem to come  up with a solution. Basically what I want is to load my Flashvars  defined in swfObject, each one holding an expression, for example:
    <script type="text/javascript">
                var flashvars = {
                 rutaMEX:"mainContainer.aspx?Country=pkbE5eknzMLhWZ5x+K3/tA=="
                var params = {};
                params.menu = "false";
                params.quality = "high";
                params.scale = "noscale"
                params.wmode = "transparent";
                params.seamlesstabbing = "true";
                params.allowfullscreen = "true";
                var attributes = {};
                attributes.id = "main";
                attributes.name = "main";
                swfobject.embedSWF("swf/landing.swf", "altContent", "100%", "100%", "10.0.2", "Scripts/expressInstall.swf", flashvars, params, attributes);
            </script>
    Right now, I have just one value pair, but I will add them as they  become available. I have 11 movieclip buttons which will take you to a  url defined by it's corresponding flashvar. If I was doing this is AS2, I  would just add this action to the button:
    button0.onRelease = function() {
        getURL(rutaMEX);, "");
    How will I accomplish the same thing in as3? I know you have to get  flashVars using .loaderInfo but that as far as i got.
    Any help will be greatly appreciated

    Redeclaring the click handler function in each loop through buttons is not necessary, you'd better do it like this, with click handler outside the loop:
    for (var i:Number=0; i<11; i++)
        menu_mc["button" +  i].addEventListener(MouseEvent.CLICK, clickHandler);
    And the second thing - click handler. For more flashvars (or if you don't know how many flashvars will be used) you can loop throug loaderInfo.parameters object with for-in loop. The problem here is that order in for-in loop is rather random ("not guaranteed" as they nicely call it :-) ), so it complicates assigning the urls to particular buttons. I would connect here name of a flashvar (this declared in HTML) with a button:
    function clickHandler(evt:MouseEvent):void
         for (var par:* in loaderInfo.parameters)
             if (evt.target.name == par) // checks if instance name of the clicked button is equal to the current flashvar, here par is NAME of the flashvar, NOT VALUE
                   var request:URLRequest = new URLRequest(loaderInfo.parameters[par]); // when the name of flashvar = name of button, the VALUE of this flashvar is retrieved in URLRequest constructor
                     navigateToURL(request,"_blank");

  • Loading external AS2 SWF in AS2

    I want to load the external SWF file which is in AS2 in to my
    SWF file which is also in AS2.. The problem I am facing is I am
    able to load external SWF but I am not able to pass the Flash vars
    to that SWF.. Here is my Code
    var _mcl:MovieClipLoader = new MovieClipLoader();
    var _listener:Object = new Object();
    _listener.onLoadInit = function(_mc:MovieClip)
    trace("Done loading...");
    _mcl.addListener(_listener);
    this._mc1.removeMovieClip(clip_1);
    this.createEmptyMovieClip("_mc", this.getNextHighestDepth());
    _mcl.loadClip("
    http://www.xyz.com/xyz/xyz.swf?200711900&local=true",
    _mc);
    So the xyz.swf is not able to read the variable local I am
    passing as a flash variable..
    So how can I accomplish passing flashvars to this xyz.swf
    Thanks

    I don't know if you can pass variables this way, but since
    you are hard coding them in AS why not pass them directly to _mc
    once your .swf has loaded?

  • Load and control AS2 interactive SWF in AS3 and get properties of AS2 swf

    Hi,
    Can anyone please tell me how to load AS2 and AS3 swf file in AS3 Loader class.  I have tried "ForcibleLoader.as, AVM1Loader.as, AVM2Loader.as but as of now I have not get successes yet. There are some issue in all library.
    I am looking for below solution.
    1) Load SWF file AS2, AS3 via flashVars params and load it in AS3 player.
    2) After successfully loaded, below properties should be shown -   
         a) totalFrames
         b) currentFrames
         c) FPS of loaded swf file
         d) Should wok play(), stop() properties of loaded swf file.
         e) SWF file should work just like video player application where we can do Play, Pause, Stop, Seek (All properties and methods
            should be supported. )
    3) Player should be capable of loading all swf file regardless of any version AVM1 AVM2 both in AS3 Player.
    4) After loading player should scale external loaded swf file as per Player stage width and height and content should be scale    
        proportionate in 4:3.
    4) AS2 & AS3 action script must be supported in AS3 player. (All interactive swf file should be supported)
    Thanks

    http://gskinner.com/blog/archives/2007/07/swfbridge_easie.html

  • FlashVar in AS3

    I'm trying to figure out how to use FlashVars in ActionScript
    3.0. I'm familiar with _root in AS2 but I've learned it doesn't
    work in 3.0. I've played around with LoaderInfo that I know should
    do the trick but I can't seem to get it to work. And I can't seem
    to find any help in any of the many threads and forums I've visited
    today.
    So I'm putting my trust in you guys. I want my button
    ("button2") to open a link in another frame ("rightFrame") through
    a FlashVar.
    I'm quite new to flash and after much banging my head in the
    wall this is what I've come up with (obviously the _root doesn't
    work but if replaced by a hard coded url with
    http:// it works like a charm):
    var myLink:URLRequest = new URLRequest("_root.linkPigs);
    button2.addEventListener(MouseEvent.CLICK,onClick);
    function onClick(event:MouseEvent):void
    navigateToURL(myLink,"rightFrame");
    Hope you can help, thanks!

    BM.,
    > I'm familiar with _root in AS2 but I've learned it
    doesn't
    > work in 3.0.
    FlashVars data is indeed stored in the main timeline prior
    to AS3, but
    you don't necessarily need the _root prefix to get to those
    variables. As
    long as you scope your object references correctly, you could
    use (for
    example) _parent from code inside a movie clip that sits in
    the main
    timeline. In other words, it's not _root that does the trick
    in AS1/AS2,
    but rather, knowing that your FlashVars data is located in
    the main
    timeline.
    > I've played around with LoaderInfo that I know should do
    > the trick but I can't seem to get it to work.
    You're on the right path. :) In AS3, FlashVars data is still
    retrievable in terms of the main timeline, only it's
    organized into the
    LoaderInfo instance associated with that timeline. Because
    the main
    timeline extends MovieClip (or Sprite), which in turn extends
    the
    DisplayObject class (further down its family tree), the main
    timeline
    features a property called loaderInfo, which references the
    LoaderInfo
    instance you need.
    var myLink:URLRequest = new
    URLRequest(root.loaderInfo.parameters.linkPigs);
    button2.addEventListener(MouseEvent.CLICK,onClick);
    function onClick(event:MouseEvent):void {
    navigateToURL(myLink,"rightFrame");
    In fact, you may not even need the "root" at the beginning
    of the
    expression inside the URLRequest constructor; it all depends
    where this code
    is being written. If this code is in a keyframe of the main
    timeline, then
    it's already in what's known as root, so the mention of
    loaderInfo is enough
    to retrieve the LoaderInfo.parameters property of that
    reference, which in
    turn gives you access to your custom linkPigs property.
    David Stiller
    Co-author, Foundation Flash CS4 for Designers
    http://tinyurl.com/5j55cv
    "Luck is the residue of good design."

  • FileName in the AS2 receiver?

    Hi Guys,
    we are sending a file to the partner with the AS2 and we want to maintain the same file name as the sender. I dont see any adapter specific attributes in the AS2 adapter.
    How can i maintain the same file in the AS2 receiver adapter. any help or suggestions would be appreciated
    Thanks,
    Srini

    Hi sarvesh,
    The problem is resolved using the seeburger AttributeMapper module.
    Thanks,
    Srini

  • Problem with Preloader in my Flash AS2 Game

    I have been using this tutorial to make a preloader:
    http://www.republicofcode.com/tutori.../preloader_bc/
    I have run into one problem though.
    When I simulate the download, it just shows the background color of the game while it loads, and when it finished loading, it shows the loading screen fully loaded. I have followed the tutorial exactly, except added my file names into the AS2 code.
    Here is the ActionScript in Frame 1 I have for the preloader:
    if (_root.getBytesTotal() != _root.getBytesLoaded()){
    stopAndGoto(1);
    preloaderBar._xscale=(_root.getBytesLoaded()/_root.getBytesTotal())*100;
    loaderTxt.text=Math.round((_root.getBytesLoaded()/_root.getBytesTotal())*100)+"%";
    Any hints or answers to what i'm doing wrong?
    Thanks, MrA615.

    Your description of what you've done and the code you show does not match what the tutorial says to do and what code to use... (there is no stopAndGoTo() function in Flash).
    Right-click the second frame on the upper layer labeled Actions and select Actions. Copy and paste the code below to make our preloader functional.
    if (_root.getBytesTotal() != _root.getBytesLoaded()){
    gotoAndPlay(1);
    bar_mc._xscale=(_root.getBytesLoaded()/_root.getBytesTotal())*100;
    loader_txt.text=Math.round((_root.getBytesLoaded()/_root.getBytesTotal())*100)+"%";

Maybe you are looking for

  • Install the Secure Document Plugin for Adobe Acrobat Reader

    I'm trying to view secure PDF files downloaded from an organization of which I'm member. My computer is registered with their site as I have linked my computer to my subsciption with their organization. Viewing PDF files downloaded from their site ha

  • How to display related links iview in content area?

    Hi, I have created Related links, but they are opening in a separate windows even though I have set the attribute of the iviews to "open in portal content area". Please let me know how I can display the iviews of the Related links in the content area

  • How to view DHCP lease from ISP on a 2811

    I have a remote site on a 2811 IOS 12.4(15).  Interface FA 0/0 faces the ISP and is set for DHCP.  What command can I run to see all of the information given out with the IP lease from the ISP?  I need to find out what the IP address of the DNS serve

  • Classes missing from autocomplete

    I'm using Eclipse with the Flex Plug-in. One of the Flex projects in my workspace suddenly no longer displays everything that should appear when the autocomplete window pops up. For example if I want to add a VBox into an mxml file and I type the "<m

  • Error in view

    I am getting an error : ORA-00904: "CD_REGION_V"."CODE_KEY": invalid identifier 00904. 00000 - "%s: invalid identifier" *Cause:   ORACLE 11G while compiling the procedure map_state_region_v CREATE OR REPLACE FORCE VIEW map_state_region_v ("st_code",