Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




FlashVars Problem



Hi, I have a banner/navigation menu on my site and I have been trying to get FlashVars to work for ages but, unfortunately, it's always failed to in either IE or Firefox and I have no idea what else I can do. I did a search on the forums and tried some solutions offered but it's always failed somewhere.
I've tried the following:
http://www.flashkit.com/board/showth...ight=flashvars
code: if( !isNaN(_root.specificFrame) )
_root.gotoAndPlay( parseInt(_root.specificFrame) )

The else if solution found here: http://www.flashkit.com/board/showth...ight=flashvars

And I've used php to call the variable in html, via query string.

Here's the ActionScript in the first frame of my .fla (all of the versions I've used... some are commented of course to disable them):
code: stop();
gotoAndStop(_root.howmany);
/*
if( !isNaN(_root.specificFrame) )
_root.gotoAndStop( parseInt(_root.specificFrame) )
*/
/*
this.onEnterFrame = function() {
if (page == "sports") {
gotoAndStop(2);
} else if (page == "calendar") {
gotoAndStop(3);
} else if (page == "results") {
gotoAndStop(4);
} else if (page == "majors") {
gotoAndStop(5);
} else if (page == "historical") {
gotoAndStop(6);
} else if (page == "links") {
gotoAndStop(7);
}
}
*/

And the SWF code on the html/php pages:
code: <?php
$ammount = "4";
?>
<div id="head">
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
width="900" height="120">
<param name="movie" value="bannerphp.swf?howmany=<?php echo $ammount; ?>">
<param name=quality value=high>
<embed src="bannerphp.swf?howmany=<?php echo $ammount; ?>" quality=high
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
type="application/x-shockwave-flash" width="900" height="120"></embed>
</object>
</div>
I have used FlashVars to and I'm sure I've done it propery. Included the param line declaring the FlashVars variable and then included the "FlashVars="blahblah"" attribute in the embed code.

Hopefully someone can give me a hand with this. Right now I've succumbed to using a separate SWF for each section
You can see the full functioning swf in separate form here: http://www.snowvalley.ws/home.php
And the attempt to get the single swf to work here: http://www.snowvalley.ws/banner/home.php

Thanks for your help.



FlashKit > Flash Help > Flash ActionScript
Posted on: 09-16-2005, 12:19 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Using FlashVars
Hi,

Has anyone used FlashVars?
http://www.macromedia.com/support/fl.../flashvars.htm
I'm using it to jump to a frame in my swf. It works great in IE but will not work in NN7. I've checked and I have the latest flashplayer but for some reason it will not work.
Any ideas?

Here's my code from the HTML page:

<PARAM NAME=FlashVars VALUE="wantframe=29"> <PARAM NAME=movie VALUE="pcb.swf"> <PARAM NAME=loop VALUE=false>
<PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#666699>
<EMBED src="pcb.swf" FlashVars="wantframe=29" loop=false quality=high bgcolor=#666699 WIDTH="760" HEIGHT="405" NAME="pcb" ALIGN="" swLiveConnect=true TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>


Thanks

Using FlashVars Help?
I want to be able to make a standard HTML button link to a certain frame within a Flash movie. I've established that I need to use FlashVars and Macromedia have a page about it in their support section. However, I'm not a programmer and could do with some help configuring the code. This is the example they gave:

OBJECT TAG EXAMPLE:

<PARAM NAME=FlashVars VALUE="foo=Hello%20World&paragraph=first+line%0Dse cond+line">

EMBED TAG EXAMPLE:

<EMBED src="display.swf" FlashVars="foo=Hello%20World&paragraph=first+line% 0Dsecond+line" ... (other parameters)> </EMBED>

Presumably this code would go on the HTML page that has the button (bottomFrame), but my Flash movie is in the mainFrame - is this a problem? The frame I would like to jump to in the movie is 270 - is there anything I need to add to my movie, ie. some actionscript, to get this working?

Any help would be greatly appreciated!

Flashvars
i am using flashvars in the param and embed tags to insurt some variables into my flash movie...but they seem local. is there a way to make them global, or available to all of my movie clips?

thanks in advance!

Flashvars And All That...
I have a script problem and I'm hoping to solve it regarding integrating a flash map with an asp page.

I have a map page:
http://www.brownsre.com/Details/Maps...p?PropertyID=7
which has a flash map embedded on it. I wish to load x and y coordinates for
the pointer on the map in a different place for each property. I have the
coordinates saved in a database which an asp page pulls out. My problem is
how do I put a dynamic querystring into the actionscript:
ie: at the moment i have the following code:

onload() {
loadvariablesnum("area_coordinates.asp",0);
}
onframe(1) {
if(vars_loaded=="ok") {
gotoandplay(3);
}
}
onframe(2) {
prevframeandplay();
}
onframe(3) {
map._x=eval("map_x");
map._y=eval("map_y");
map._xscale=eval("map_xscale");
map._yscale=eval("map_yscale");
}
onframe(4) {
stop();
}

This works perfectly if I load static values for the map_x and map_y
variables in the "area_coordinates.asp" page, however I need the page to be
"area_coordinates.asp?PropertyID=7" with the PropertyID value changing
depending on which property they are viewing.

What is the best way to achieve this? Should I be using Flashvars? (ie:
<param name="flashvars" value="asp=area_coordinates.asp<%=PropertyString%> ")
Please note that I am a total beginner when it comes to actionscript.

with thanks

Brian

Flashvars
Hi guys
Im completely stuck here!

I need a way of using flash vars and have no idea at all.
Im know flash very well, its just i dont know about this.
Im using MX.

I need away of creating the <embed> code , that displays the .swf in HTML, from another flash movie. I need the EMBED code to include the parameter flashvars, storing variables which the user defines in the previous movieclip.

I hope that makes sense!

Please someone help me or even just link me to a tutorial.

Thanks a million!

http://www.flaveret3rd.com

FlashVars
FlashVars

Can anyone give a scenario that FlashVars is useful in?
I am learning the action scripting _lingGauge:E and I am uncertain of the usefulness of FlashVars.

THX
ODC

Flashvars
If in the html code to embed my flashdoc i put flashvars="var1=one" how would i load that when my document starts?

thanks

Flashvars?
ok i have this code in my movie.....


_root.commbox.commtxt.text=comments;


comments is a variable created by php in the html page the swf sits in....
it all works great ...gets the text and all,but it wont scroll.....i mean i can scroll it using the mouse wheel but the scrollbar button never shows up. the textbox and the scrollbar are linked in the scrollbar properties....
I even tried copy and pasting one i had working into this still no luck.

any help will be appreciated

FlashVars
Hello,
i have a problem with FlashVars from a html file

In html page i have <param name="Flashvars" value="val=asdfas aksdf as" />

I can read this variable in level0 Stage 1 like this txt = _level0.val

But i need it inside a movie clip named main. This movie is in stage 1 .

The problem is that i can`t read this val in main

Do you know what can i do?

Thanks,
Florin

Flashvars
Okay, ive asked this question a few times in the past and nothing really helped..... how do i load a variable from html code? heres and example:

<embed src="http://petswf.bunnyherolabs.com/adopt/swf/penguin" width="250" height="300" quality="high" bgcolor="ffffff" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="cn=penguin&an=nick&clr=0xe2f801" type="application/x-shockwave-flash">

this flash file takes that code in bold and loads it so that "penguin","nick", and "0xe2f801" can be used within the file itself.... how do i do this? i only need one variable. how do i load it with the actual flash movie?

FlashVars
I am trying to assign a button inside my flash movie a URL through a FlashVar in my html. Can this be done? What is the code I need to put on my button? I am assuming I need to give my button an instance name, but how do I get the button to look at the code from the Flashvar html when I click on it? Do I need to create a variable?

Thanks in advance,

Mike

[AS2.0] FlashVars?
Hello,

I want to share my .swf file with others (pretty much the way that YouTube
does, which means by allowing them to copy and paste <object> tags into
their web pages). The movie is available in several different languages and all
translations are pulled from text files.

I would like to be able to choose the language version during the process of
'embedding' the swf file on a user's page, by adding this kind of parameter
to the <object> tag:
<param name="FlashVars" value="lang=en">

Then, inside the swf file, there's a simple code like:
var langdef = _level0.lang;
var langfile = "translations_"+langdef+".txt";

which is supposed to define the translations from the external file - in
this case, from the translations_en.txt file.

The thing is that this kind of thing doesn't want to work. Apparently Flash
player just disregards the FlashVars parameter. I confirmed this by going to the following page and the code posted there also didn't work:
http://livedocs.adobe.com/flash/9.0/...=00000668.html

How can I use the FlashVars parameter so it works?

Best Regards,
prezzz

FlashVars
Does anyone know if you can have two flashVars values in one swfObject movie? It seems like when I have one, it works, but when I try to add two it breaks it. and neither responds. Below is the code that I am trying to implement. Not sure if both the values need to be in the same parameter or not? and if so how would it lay out.


<div id="flashNYLO"></div>

<script type="text/javascript">
var so = new SWFObject('testhomepagelink.swf',
'mpl','550','400','8');
so.addParam("quality", "high");
so.addVariable("wmode","transparent");
so.addParam("flashvars","var1=plano");
so.addParam("flashvars","var2=home");
so.addVariable("bgcolor","#ffffff");
so.addVariable("allowScriptAccess","transparent");
so.write('flashNYLO');
</script>

thanks in advance,
Mike

Flashvars In AS3...
AS3 is really frustrating.. Why make it so uncomfortable?

Here's my problem, I'm trying to pass a variable through FlashVars but it won't work:

Code:
if (root.loaderInfo.parameters.m_id){
caps.source = "xml/subs.php?m_id="+root.loaderInfo.parameters.m_id;
} else {
caps.source = "xml/err.xml";
}
And this is my html:

Code:
<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="alex" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<PARAM NAME=FlashVars VALUE="m_id=1" />
<param name="movie" value="alex.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />
<embed src="alex.swf" FlashVars="m_id=1" quality="high" bgcolor="#ffffff" width="550" height="400" name="alex" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

[CS3] Flashvars AS2
Hi everyone,

I have a question for you. Im tryin to use flashvars, so that depending on the variable sent to the flash movie it would go and play a specific scene. So let me set the scenario for you. I have an index.php page which has three buttons. If the user clicks button1 it opens a popup.php that contains the flash movie and plays the flash movie relative to button1. if the user clicks button2 it opens that same popup.php playing the scene relative to button2, and as im sure you've guessed. if the user clicks button3, it opens popup.php playing the scene relative to button3.

The code inside the flash movie is:

if(section=="connaught"){
//gotoAndPlay("ConnaughtHome");
section_text.text = "connaught";
}else if(section=="excel"){
// gotoAndPlay("ExcelHome");
section_text.text = "excel";
}
else if(section=="stratford"){
// gotoAndPlay("StratfordHome");
section_text.text = "stratford";
}

I would be greatful if you could help me find a solution to this problem. I put a test version of the site up at http://www.wineandmint.co.uk/fox so at the moment it reads the correct section but doesnt go to and play the relative movie. Any suggestions would be appreciated.

Kind regards,

Tarlochan

Flashvars Help
Hi There,

below is partial code from a Flash Video gallery file which references an XML doc. I have the swf embedded in an HTML document, and right now it loads at the beginning of the XML list. Is it possible to adjust the value of videoIndex to be 2 from within the HTML?

Any help is greatly appreciated


var videoIndex:Number= 0;

flvControl.source = videoList[videoIndex];
my_scroller.source = holder;
rightLogo.source = logoList[videoIndex];
rightBullet1.source = bullet1List[videoIndex];
rightBullet2.source = bullet2List[videoIndex];
rightBullet3.source = bullet3List[videoIndex];
rightBullet4.source = bullet4List[videoIndex];
rightBullet5.source = bullet5List[videoIndex];
rightBullet6.source = bullet6List[videoIndex];
rightBullet7.source = bullet7List[videoIndex];
rightEditor.text = editorList[videoIndex];
rightPosition.text = editorTitleList[videoIndex];
rightTitle.text = bulletTitleList[videoIndex];
rightDetails.text = vidDetailsList[videoIndex];
rightPoint1.text = vidPoint1List[videoIndex];
rightPoint2.text = vidPoint2List[videoIndex];
rightPoint3.text = vidPoint3List[videoIndex];
rightPoint4.text = vidPoint4List[videoIndex];
rightPoint5.text = vidPoint5List[videoIndex];
rightPoint6.text = vidPoint6List[videoIndex];
rightPoint7.text = vidPoint7List[videoIndex];
rightClick.text = moreinfoList[videoIndex];
rightUrl.text = urlTitleList[videoIndex];
rightVisit.text = clickList[videoIndex];
rightBtmUrl.text = webTitleList[videoIndex];
artistVar = artistList[videoIndex];
infoVar = infoList[videoIndex];
timeVar = timeList[videoIndex];


}

Flashvars?
I have a flash file setup to play an mp3, just a simple player at the moment.
the followinf code tells it what the file to play is

s = new Sound();
s.loadSound("test.mp3",true);
gotoAndPlay("Playing");

what i want to do is pass the name of the mp3 file from the param tag in the html page

i have tried the following

<param name="Flashvars" value="&mp3file=test.mp3">

but cant figure out how to get this variable in the actionscript

can anyone help??

Help With FlashVars In AS3
Well I've read a few of the threads on accessing flashvars with AS3 and am still grappling with it, I'm hoping someone who has tackled this will take mercy on my poor soul and help me out.

Essentially I've inherited making some changes to a flash file (a cover loader, carousel, media player thingy) that was built by a couple of other developers and am stumbling around - and I'm new to AS3.

The project is constructed with a number of classes and packages and I have imported the LoaderInfo / import flash.display.LoaderInfo;

and assumed I could simply access the flashvars like this:
public var loadV = root.loaderInfo.parameters.loadVideo;

where loadV becomes the value I pass into the function that tells the carousel which cover to stop on. and loadVideo is the flashvar value in the html page

I also tried this approach, but neither worked for me:
public var flashvars:Object = LoaderInfo(this.root.loaderInfo).parameters;
public var tloadVideo = flashvars['loadVideo'];

[CS3] FlashVars
I want to have two FlashVars but i'm not exactly sure how...

Here is what i have done so far:

AS3:

PHP Code:



var MusicName = "";var varName:String;var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;for (varName in paramObj) {    MusicName = String(paramObj[varName]);}




HTML:

PHP Code:



<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="300" height="120">  <param name="movie" value="musictest.swf" />  <param name="quality" value="high" />  <param name="FlashVars" value="MusicName=hello" />  <embed src="musictest.swf" width="300" height="120" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" flashvars="MusicName=hello"></embed></object>




Thanks in advance!

[F8] MP3 Get FlashVars
Hi all,

Really stuck here with what I'm sure is an easy thing to fix, just can't work it out myself, been searching all day!

Basically trying to build an MP3 player which uses a FlashVar to determine the url of the MP3 file.

I've set the FlashVar in the html like so:

FlashVars="sound=http://michaelgrant.podbean.com/medias/play/aHR0cDovL21lZGlhNS5wb2RiZWFuLmNvbS84NjYwOS91LzAzVH JhY2szLm1wMw/03Track3.mp3"

My problem is I'm not sure how to collect or use this Var in the flash movie?

Any help massively appreciated.

Many thanks

FlashVars Help
I'm working with an asp programmer who has the following FlashVars code on her index.asp page (basically sending PageID values to flash to tell flash what to do):

<PARAM NAME=FlashVars VALUE="

<%
Select Case strPageRequested
Case "home"
response.write "PageID=home"
Case "picturesDefault"
response.write "PageID=picturesDefault"
Case "downloadsDefault"
response.write "PageID=downloadsDefault"
end select
%>

">

<embed src="myswf.swf" FlashVars="

<%
Select Case strPageRequested
Case "home"
response.write "PageID=home"
Case "picturesDefault"
response.write "PageID=picturesDefault"
Case "downloadsDefault"
response.write "PageID=downloadsDefault"
end select
%>

" quality="high" bgcolor="#c75100" width="895" height="819" name="myswf" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>

__________________________________________________ ___



on the first frame in my .fla I have:

if (PageID == "home") {
gotoAndPlay("main1");
} else if (PageID == "picturesDefault") {
gotoAndPlay("main2");
} else if (PageID == "downloadsDefault") {
gotoAndPlay("main3");
}

--flash doesnt respond to the "picturesDefault" and "downloadsDefault" and go where I want it to go....am I missing something? do I need to load variables or declare them?

thanks!!

Flashvars Help
I am working on a hybrid site that has html pages with a flash navbar. When a page loads I would like to use flashvars to tell the navbar.swf to go to the over state of that mc button. For instance, when the index page loads I would like to tell the .swf to go to _root.home and play the over label.

I have been banging my head against the wall trying to get this work. I looked at some other flashvars posts, but can't find anything similar. Thanks to everyone in advance for suggestions.

EW

How To Use Flashvars In As3
hi,

I searched livedocs and many forums about actionscript 3. In as3 it was really easy to receive parameters from the embed code. i only used the _root-variables to get the parameters i needed. in as3 its not that simple. I made a actionscript-project in Flex with only one class:


Code:
package {
public var userid:String;
public class testClass extends MovieClip()
{
public function testClass()
{
// in as2 i got the userid like that
userid = _root.userid;
// in as3???


}
}
}
can anyone help me with that simple question?

Using Id Instead Of Flashvars?
<OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" ID=Changeable WIDTH=200 HEIGHT=50><PARAM NAME=movie VALUE="../ObjectFiles/LE_35256.swf"><PARAM NAME=quality VALUE=high><EMBED SRC="../ObjectFiles/LE_35256.swf" AUTOPLAY=TRUE WIDTH="200" HEIGHT="50" swLiveConnect=true name=Changeable><noembed></noembed></EMBED></OBJECT>

Thats my embed code, is there a way to read what is in bold from flash?
No i do not have the ability to use falshvars

Flashvars, PHP
i'm having trouble wrapping my mind around a flashvars problem. any help would be great.

i have an admin.swf page that writes form data into a MySql db table via a file called save.php

i have a user.swf (embedded in index.php) that needs to display the admin data (via a file called load.php), as well as write new selections to a different MySql db table (via a file called savetake.php).

The trouble: when the admin table is populated, i need to, basically, create an individualized user.swf based on the specific record the admin created. i want to use LaodVars (possibly) to tell the user.swf to use a specific row of data from the table (via the unique id). AKA: "Flash, i need you to use/display the row of data that contains this unique id". i'm not sure what i am doing!

The file called save.php queries the db to get the unique id:

Code:
$result = mysql_query($sql);
$db_id = mysql_insert_id();
The file called index.php contains the FlashVars:

Code:
<param name="movie" value="./master.swf" />
<param name="flashvars" value="<?=$db_id?>"
<param name="quality" value="high" />
<embed src="./master.swf" flashvars="<?=$db_id?>" ...</embed>
SO- in Flash, i don't know how to code for the variable. but i'm starting from here:



Code:
myData = new LoadVars()
myData.load("???????.php?id = db_id", myData);
//Callback handler and binding
myData.onLoad = function(succes){
if(succes){.....
How does Flash know the variable i am passing is intended to tell it which record to use? Which PHP file do i actually call? should i combine some of these PHP files (even if they have different uses and use different tables)? Not to mention, i'm using a master.swf as a MCL for the user.swf- do i put the above code in the master.swf or the user.swf?

i'm ok at this stuff, but this is my first go at this concept, so i am having troubles....
thanks!
alison

FlashVars
I need help with this!! =P

Basically I need to load a few audio clips externally via FlashVars. I got the whole object/embed coding but I don't understand what I need to code in my flash file so that once I hit the "play" button, it realizes that oh, i have to play this file that is specified in the html file.

Any idea??

Thanks,
aims

FlashVars
Hey Everyone,

I was wondering if someone can look over my code and tell me how incorrect it is. I have a Header swf file on a website that should be one big button that takes the viewer to web page A or web page B, depending on what variable is sent to it. Using Flash 8, I am not too good with AS, but I believe i still need to have a button loaded before this to actually be clickable to then take me to the new web pages. I believe this is only going to ad text field to my swf, but this is what was told to me.

Can someone please help me with this?


ActionScript Code:
this.createTextField("BasePath", 100, 0, 0, 100, 20);
BasePath.autoSize = "left";
if (_level0.myURL == undefined) {
    BasePath.text = "http://zachdorman.cmh.realliving.net/franchise/Brand.aspx";
} else {
    BasePath.text = _level0.myURL;
}

Get Var From FlashVars
This is my first actionscript. Partly mine It's a script to load images and when you click on it, you see the next image. The names of the pictures are in de 'images.txt'-file. The bug is probable in this line: text_var=nameVars.member; I want to get the 'member'-string from FlashVars. By use of 'FlashVars="member=adriaan"' But how to get the var from FlashVars?


HTML Code:
<param name="FlashVars" value="member=adriaan" />

ActionScript Code:
var nameVars= new LoadVars();
nameVars.onLoad=function(ok) {
    text_var=nameVars.member;
    trace(text_var); //output: undefined, it has to be:
    //adriaan_1.jpg,adriaan_2.jpg

    var myArray:Array = text_var.split(",");
    counter = 0;
    first_img = myArray.length-1;
    myLoader.contentPath = myArray[first_img];
    myLoader.onRelease = function (){
        if(counter < myArray.length){
            myLoader.contentPath = myArray[counter];
            counter++;
        }
        else{
            counter = 0
            myLoader.contentPath = myArray[counter];
            counter++;
        }
    };
};
nameVars.load("images.txt");


Code:
images.txt:
&nick=nick_1.jpg,nick_2.jpg&adriaan=adriaan_1.jpg,adriaan_2.jpg

Trying To Use FlashVars
Hi,
I am trying to use flashVars for the first time, with no success. The swf file comes up, but the fileName is null. I'm guessing its something simple but I've been trying various solutions for about 3 hours and I'm out of ideas!

Based on a number of online tutorials, here is my as3 code:


ActionScript Code:
package {
    import flash.display.*;
    import flash.text.*;
   
    public class TestApp extends MovieClip {
        public function TestApp() {
            var fileName:String = root.loaderInfo.parameters.myFileName;
            var t = new TextField();
            t.autoSize = TextFieldAutoSize.LEFT;
            t.text = "The filename is..." + fileName;
            addChild(t);
        }   }   }

And the html file (using dreamweaver)


HTML Code:
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','550','height','500','title','PreQuiz Reloaded','src','../Prequiz','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','../Prequiz' ); //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,28,0" width="550" height="500" title="PreQuiz Reloaded">
<param name="movie" value="../Prequiz.swf" />
<param name="quality" value="high" />
<param name="FlashVars" value="myFileName=prequiz"/>
<embed src="../Prequiz.swf" FlashVars="myFileName=prequiz" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="550" height="500"></embed>
</object></noscript>
If I run this inside Flash and do a trace on root.loaderInfo.parameters, the output confirms its an Object. But the textbox (both in flash and in a browser) says the filename is null.

Thank you!!

Help With Flashvars :)
Can someone please help me with my flashvars problem.

I want to use flashvars to dynamically insert variables into my actionscript but im having some issues.

I am trying to pass two variables called artistName and orderNum. Here is my js:


Code:
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '230',
'height', '30',
'src', 'main',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'main',
'bgcolor', '#333333',
'name', 'main',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'main',
'flashvars', 'artistName=johnd&orderNum=1',
'salign', ''
); //end AC code
and here is my html:


Code:
<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="230" height="30" id="main" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="flashvars" value="artistName=johnd&orderNum=1" />
<param name="movie" value="main.swf" />
<param name="quality" value="high" /><param name="bgcolor" value="#333333" />
<embed src="main.swf" flashvars="artistName=johnd&orderNum=1" quality="high" bgcolor="#333333" width="230" height="30" name="main" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</noscript>
and here is my actionscript to retreive the variables.. i got this from searching the web for examples.. nothing i find seems to work.. i get errors saying that the parameter im using the variable for is null.


Code:
var artistVar:String = root.loaderInfo.parameters.artistName;
var orderVar:String = root.loaderInfo.parameters.orderNum;
any insight would be greatly appreciated!

Q About FlashVars
I'm trying to pass a var to an swf but it doesn't seem to recognize that anything was passed. The html I'm sending is


ActionScript Code:
<object width="550" height="400">
<param name="movie" value="absoluteUrlToSWF">
<param name="FlashVars" value="xmlFileName=absoluteUrlToXML">
  <embed src="absoluteUrlToSWF" width="550" height="400"
  FlashVars="xmlFileName=absoluteUrlToXML">
</embed></object>

But since I don't want xmlFileName to ever be null, it's defined in the root as

ActionScript Code:
var xmlFileName=absoluteUrlToDefaultXML

No matter what I pass in the html, the default XML info is always being loaded. Does the passed var in HTML have to be undefined in the swf object?

Getting FlashVars?
I've just finished a simple flash program that should load an image from a FlashVar, allow you to drag-and-drop some text anywhere on the image, then submit the positions of the text to a PHP script.

It all seemed to work when I was testing it with a static image URL. But when I tried to make it work with a FlashVar, nothing happens.

Here's the code I'm using to get the FlashVar named "imageURL":


Code:
root.loaderInfo.parameters.imgURL;
Is that correct? I then have, in the HTML file, this line added to the Javascript parameter array (part of the ActiveContent scripts):


Code:
'imgURL', 'PowerPlayer_logo.png'
Then this added into the <object> code, just above the tag with the "movie" parameter:


Code:
<param name='FlashVars' value='imgURL=PowerPlayer_logo.png'/>
Yet no image loads, and when I try to set the text of a dynamic textbox to the value of root.loaderInfo.parameters.imgURL, the text does not change.

What am I doing wrong?

-IMP

XML & FlashVars In AS3
I want to load xml from FlashVars in AS3 for a video player, but I can't seem to figure it out. Here is the Actionscript I'm using to load XML and set up the video player.


ActionScript Code:
package {
    import flash.display.MovieClip;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.Event;
    import fl.controls.listClasses.CellRenderer;
    import fl.controls.ScrollBarDirection;

    public class VideoPlaylist extends MovieClip {
        private var xmlLoader:URLLoader;
       
        public function VideoPlaylist():void {

            xmlLoader = new URLLoader();
            xmlLoader.addEventListener(Event.COMPLETE, initMediaPlayer);
            xmlLoader.load(new URLRequest("playlist.xml"));

            tileList.setSize(225, 210);
            tileList.columnWidth = 210;
            tileList.rowHeight = 70;
            tileList.direction = ScrollBarDirection.VERTICAL;
            tileList.setStyle("cellRenderer", Thumb);
        }
       
        public function initMediaPlayer(event:Event):void {
            var myXML:XML = new XML(xmlLoader.data);
            var item:XML;
            for each(item in myXML.vid) { // populate playlist.

                var thumb:String;
                if(item.hasOwnProperty("@thumb")>0) thumb = item.@thumb;

                tileList.addItem({label:item.attribute("desc").toXMLString(),
                data:item.attribute("src").toXMLString(),
                source:thumb});;
            }
            tileList.selectedIndex = 0;

            tileList.addEventListener(Event.CHANGE, listListener);

            myVid.source = tileList.selectedItem.data;

            myVid.pause();
        }

        function listListener(event:Event):void {
            myVid.play(event.target.selectedItem.data);
        }
    }
}


What do I need to add or replace? Would I need to add something like this:
xmlLoader = myXMLPathFlashVar; ? If so where? Thanks for any help.

FlashVars In AS3?
Hi,

I have been reading this helpful page:

http://blogs.adobe.com/pdehaan/2006/...actionscr.html

It is about exporting flash variables in AS3 so they can be assigned in html. I can get it working fine in AS2 but I am working on an AS3 file and am really stuck.

I have a video height and video width that needs to be set and also the videoURL, these are all variables I want to control with html...


ActionScript Code:
video = new Video();
video.x = xlength;
video.y = ylength;

thanks,

dan

FlashVars URL, FLV
I have a Flash video player component and a list component in a flash movie that I have created. I have populated the list manually in the actionscript, but am moving away from that to an XML list.

I have various products featured in these videos and I would like a way to pass a variable to flash through an URL that would select the corresponding video for the user.

For example, if they are on a page about oranges I would like the link that says "Click here for videos" to have an appended statement that loads the video in the correct component. I've tried various permutations of example.html?contentParameter=("url"), example.html?file="url" (where file= is an empty flashvar), example.html?ns.play="url", etc, but none of them seem to work for me. Anyone have any ideas? Thanks!

FlashVars
I want to make various aspects of a movie variable - things like colours, various titles. So far I've had global variables in the first frame, but I'd now like these to be defined in an external source.

Am I right in thinking that best way to load variables is via FlashVars, because the variables are immediately available and don't need any parsing code?

If so, what then is the best way for testing the movie within Flash CS3? As the variables are now over in the HTML file, I have to go over to Dreamweaver or a browser and test a compiled SWF. I guess I could always copy the FlashVars param from DW, paste it into AS and then split it out into a variable, but that seems a bit awkward. What's best practice here?

John

Flashvars
Sorry for what is a newbie question, but here it is... I want to be able to send out an html email with a couple of clickable links to specific frames in a flash movie. After doing a little research, I have found that this has to do with flashvars. Does anyone know of a good tutorial on this subject?





























Edited: 09/09/2008 at 11:28:57 AM by jvalerie_1

FlashVars
Dear All,

Newbie here. I'm using Web Page Maker to create my website. I have flash movies there (panorama VR). In the property box, there's an option for me to type in FlashVars.

My question is this: What is FlashVars and is it important? Will it help page ranking?

Thank you in advance for replying

Ben

FlashVars
Isn't there at least one big strong man who can help me with this.

I do have a question in regards to FlashVars and how you test for the existance of a certain value inside a SWF movie?

This code right here works fine for me.
if (_level0.myURL == undefined) {

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

However, it is not what I need. I want to be able to setup an if statement with multiple else if statements. I have tried almost every possible combination except the correct one.

Here is what I would like to do. If _level0.myURL == 1 then gotoPage(1) & gotoAndStop(1) else if _level0.myURL == 4 then gotoPage(2) & gotoAndStop(4)

Can you please tell me what is the correct syntact for doing this.

FlashVars Bug In CS3?
I have a problem similar to that of a previous poster, the solution to which I'm unable to adopt.

I'm using CS3 > ActionScript 2.0 and am unable to get FlashVars working.

Has anyone been able to successfully use FlashVars in CS3 using AS2.0 and/or recreate the quick app in the help file?

Any help would be greatly appreciated.









Attach Code

Code in html page:

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

Code in Frame 1 of SWF file:

this.createTextField("myTxt", 100, 0, 0, 100, 20);

if (_level0.myURL == undefined) {
myTxt.text = "myURL is not defined";
} else {
myTxt.text = _level0.myURL;
}

Substituting _root for _level0 has no effect, have run on Mac, PC, in Safari, IE and Firefox.

























Edited: 05/17/2007 at 09:10:21 AM by mr_delete_happy

Flashvars
hi,

I'm trying to parse my swf a flashvars called opener which is set to true, the html is attached.

How do i call opener in the actionscript, i had just done it in the header

var newVariable = opener;

But this doesnt seem to work....

bit of extra info for you, i have to html, i cant use JavaScript to do this as it's going to be used on a site that doesnt allow javaScript.

thanks

Greg









Attach Code

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="750" height="625" id="postAndLoadTestzzj" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="postAndLoadTestzzj.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />
<PARAM NAME=FlashVars value="opener=true" />
<embed src="postAndLoadTestzzj.swf" quality="high" bgcolor="#ffffff" FlashVars="opener=true" width="750" height="625" name="postAndLoadTestzzj" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" />
</object>

Flashvars
Hi everyone,

Im trying to use flashvars, so that depending on the variable sent to the flash movie it would go and play a specific scene. So let me set the scenario for you. I have an index.php page which has three buttons. If the user clicks button1 it opens a popup.php that contains the flash movie and plays the flash movie relative to button1. if the user clicks button2 it opens that same popup.php playing the scene relative to button2, and as im sure you've guessed. if the user clicks button3, it opens popup.php playing the scene relative to button3.

I would be greatful if you could help me find a solution to this problem. I put a test version of the site up at http://www.wineandmint.co.uk/fox. so at the moment it reads the correct section but doesnt go to and play the relative movie. Any suggestions would be appreciated. Thanks :)







Attach Code

The code inside the flash movie is:

if(section=="connaught"){
//gotoAndPlay("ConnaughtHome");
section_text.text = "connaught";
}else if(section=="excel"){
// gotoAndPlay("ExcelHome");
section_text.text = "excel";
}
else if(section=="stratford"){
// gotoAndPlay("StratfordHome");
section_text.text = "stratford";
}

FlashVars
I have posted elsewhere but to no avail... trying to pass an image name through FlashVars from a php request into a .swf so that the image will load on runtime... anybody ever heard of this... can it be done?

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="

FlashVars Help
Hi,

I'm trying for days now to find a solution for my problem.

I'm transferring flashvars from my html to the swf file but I don't know how to read them in the flash file.

I search lots of forums and used the example in flash help but it doesn't work.

I use Flash CS3 with actionscript 2.

My code in the first frame is:

if (_level0.xmlFile == undefined) {
xmlFiles = "xml/albuminfo.xml";
} else {
xmlFiles = _level0.xmlFile;
}

My code in the html file is:

<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="

Flashvars With Ie 7.0.6
Hello,

I'm using the following code to run a flash file with flash vars passed in. It works perfectly in all target browsers on all platforms up to ie 7.0.6. It works fine in ie 7.0.5730.11, but breaks on ie 7.0.6000 and i've tested on multiple machines.

<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=8,0,0,0',
'width', '986',
'height', '115',
'src', 'menu_head',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'menu_head',
'bgcolor', '#ffffff',
'name', 'menu_head',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', '/media/swf/menu_head',
'FlashVars','urlNavTop=real&urlNavMid=forSale&urlNavBot=sites',
'salign', ''
); //end AC code
}
</script>

any ideas?

Thanks!

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.







Attach Code

--AS 2.0--Layer 1, Frame 1
this.createTextField("my_txt", 10, 10, 10, 100, 21);
my_txt.text = _level0.username;

--HTML--
<!-- saved from url=(0013)about:internet -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>flashvars</title>
<script language="javascript"> AC_FL_RunContent = 0; </script>
<script language="javascript"> DetectFlashVer = 0; </script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 24;
// -----------------------------------------------------------------------------
// -->
</script>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<script language="JavaScript" type="text/javascript">
<!--
if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if(hasRightVersion) { // if we've detected an acceptable version
// embed the flash movie
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,24,0',
'width', '550',
'height', '400',
'src', 'flashvars',
'quality', 'medium',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'flashvars',
'bgcolor', '#ffffff',
'name', 'flashvars',
'menu', 'true',
'allowScriptAccess','sameDomain',
'allowFullScreen','false',
'movie', 'flashvars',
'salign', ''
); //end AC code
} else { // flash is too old or we can't detect the plugin
var alternateContent = 'Alternate HTML content should be placed here.'
+ 'This content requires the Adobe Flash Player.'
+ '<a href=http://www.macromedia.com/go/getflash/>Get Flash</a>';
document.write(alternateContent); // insert non-flash content
}
}
// -->
</script>
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="550" height="400" id="flashvars" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="flashvars.swf" />
<param name="FlashVars" value="username=Thomas" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="flashvars.swf" FlashVars="username=Thomas" quality="high" bgcolor="#ffffff" width="550" height="400" name="flashvars" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
</noscript>
</body>
</html>

Using FlashVars
I wrote a tutorial on my blog about using FlashVars. The reason I post this here is not to self promote (although that never hurts) but because it helped me greatly in a recent project I just did so I thought i'd share the wealth for anyone that may end up needing something like this or has needed it in the past and didn't know it existed. It's nothing revolutionary, but like i said, it can help someone out. I knew it existed before but I never had a use for it until now, so anyway, without rambling about it much longer, you can view the tutorial at:

http://blog.reintroducing.com

and grab the source files at:

http://blog.reintroducing.com/tutori.../flashvars.zip

I would post it here but its a bit long for a forum post, so if you want to read it, i suggest visiting the blog, if you just want to see the results, just grab the zip file.

Using FlashVars
Hi,

I'm using the same SWF file for all my web pages, but i do not want it to play from frame 1 for all the pages. Each html page i send a FlashVar telling the swf file as to where(label) to start playing from. The actionscript always showed the variable as undefined.


<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/s...rsion=6,0,29,0" width="139" height="70">
<param name="movie" value="../gifs/fac.swf">
<param name="quality" value="high">
<param name=flashVars value="myName=Entrance" />
<embed src="../gifs/fac.swf" width="139" height="70" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" myname="Entrance"></embed>
</object>


in the FLA

recText.text=_root.myName

goToAndPlay(recText.text);

When i display the value of recText.text, it displays "undefined"

Can i get help on this ?

FlashVars
Hey,
Ive found a bunch of tutorials on how to embed a FlashVar but I havent seen any that show the how the flash file reads it (the actionscript). can someone give me a simple example with the HTML embed section and very basic actionscript that reads it? It be a great help.

Copyright © 2005-08 www.BigResource.com, All rights reserved