Reading Querystring into FLASH variable
I can't believe I can't make this work. I've even done this
in the past, but everything I try, fails.
i want FLASH to read the querstring value from the address
bar, apply that value to a variable, and be able to use it. I've
read the articles all over the net about grabbing the QS value in
the page that loads the SWF and sticking it into the embed and
movie tags as well as the ones about using PARAM=FLASHVARS etc.
can't make it work.
I can grab the QS value in the .asp page that loads the SWF,
but I can't for the life of me pass that value into FLASH. Can
someone please give me two things:
1. whats the most effective/efficient way to pass the
variable
2. the syntax for assigning the value to a variable in FLASH
Thanks tons all!
found something new to try, but still no luck...but closer
maybe:
This is the code generated by Dreamweaver when I dump the
FLASH into the page PLUS what I added:
<script type="text/javascript">
AC_FL_RunContent( 'codebase','
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','wid th','859','height','1250','src','randomItemGallery_v2','quality','high','pluginspage','htt p://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','bgcolor ','#000000','movie','randomItemGallery_v2','FlashVars','galpick','allowScriptAccess','same Domain');
//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="859" height="1250">
<param name="movie" value="randomItemGallery_v2.swf"
/>
<param name="quality" value="high" />
<param name="BGCOLOR" value="#000000" />
<param name="FlashVars"
value="galpick=<%=strGallery%>" />
<param name="allowScriptAccess" value="sameDomain" />
<embed src="randomItemGallery_v2.swf" width="859"
height="1250" quality="high" pluginspage="
http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"
type="application/x-shockwave-flash" bgcolor="#000000"
flashvars="galpick=<%=strGallery%>"
allowScriptAccess="sameDomain"></embed>
</object>
</noscript>
I added:
'FlashVars','galpick' to the AC_FL_RunContent block
<param name="FlashVars"
value="galpick=<%=strGallery%>" /> to the object block
flashvars="galpick=<%=strGallery%>" to the embed block
<%=strGallery%> is called above all of this to grab the
querystring item I need to pass in. In this case it is g=2. This is
working...when I view the source of the ASP page, the embed and
object blocks of code have the right value for galpick
Then in the FLASH file on frame one:
var galvar:String
var keyStr:String
var paramObj:Object =
LoaderInfo(this.root.loaderInfo).parameters;
for (keyStr in paramObj) {
galvar = String(paramObj[keyStr]);
from what the code tutor said, this should grab the param
passed by flashvar and write it to the variable galvar
Then I put a dynamic text box on stage and gave it an
instance name of galpicker and added this code to the FLASH file:
galpickertxt.text = galvar;
When I load the page on the server, the text box reads
undefined.
Similar Messages
-
'Reading' PDF into Flash Movie
All,
I have a client who is looking to have a 'configurator'
developed in Flash. What it needs to do is to 'read' a vector
graphic which is uploaded to the web server in PDF format into the
flash movie for manipulation. The manipulation may include scaling
the image size or rotating the image.
Upon completion of manipulation of the image the user would
submit the results of the manipulation which would pass parameters
back to the application server/database which would allow my
customer to print the resulting image in volume.
I guess the question are as follows:
Can you read the vector graphic from a PDF and pull it into
a Flash movie?
Can a configurator of this type be built?
Not only do I need to know IF it can be done, I need to
subcontract someone to do the work. I would also need to integrate
this into the rest of the application which will be ColdFusion 7
and Oracle 10g. Any takers, please email me.
Thanks,
Neil Ross
Codesweeper
[email protected]All,
I have a client who is looking to have a 'configurator'
developed in Flash. What it needs to do is to 'read' a vector
graphic which is uploaded to the web server in PDF format into the
flash movie for manipulation. The manipulation may include scaling
the image size or rotating the image.
Upon completion of manipulation of the image the user would
submit the results of the manipulation which would pass parameters
back to the application server/database which would allow my
customer to print the resulting image in volume.
I guess the question are as follows:
Can you read the vector graphic from a PDF and pull it into
a Flash movie?
Can a configurator of this type be built?
Not only do I need to know IF it can be done, I need to
subcontract someone to do the work. I would also need to integrate
this into the rest of the application which will be ColdFusion 7
and Oracle 10g. Any takers, please email me.
Thanks,
Neil Ross
Codesweeper
[email protected] -
HI
HOW CAN I READ VALUE INTO ONE VARIABLE.???
ie,
IN RUNTIME IF IM ENTERING VALUE TO VARIABLE 'A' MEANS HW CAN I TAKE THE VALUE TO 'A'.DYFIELDS-FIELDNAME ='<Parameter Name>'.
APPEND DYFIELDS.
DATA DYFIELDS LIKE DYNPREAD OCCURS 1 WITH HEADER LINE.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = DYFIELDS .
READ TABLE DYFIELDS INDEX 1.
This function module will read out the values into Internal table DYNFIELDS.
Use this function module at " On value request for <parameter>. -
Inserting a variable value from querystring into captivate and out again
I am using Captivate 4 on a server that uses ASP and I use FrontPage to write my ASP pages.
I have a database built and hosted at the same location as my captivate file. I used to launch my captivate and then have the user continue to a form page, enter their information and submit to the database. This all worked great.
Now I need to capture completion of several captivate files (modules). So I want an ASP page that allows the user to see what modules are done (I use a request form to search my database). It works great. It comes back and tells the user what needs to be taken. They, on that same page, can then select the module to complete next (I have the request querystring added to the URL that launchs the captivate file (I changed it from a html page to an asp page).
It launches fine but I can't figure out how to get that request querystring into captivate as my variable value. question 1
Then after that is figured out I need to know how to pass that variable back to an ASP page that will contain form questions that will then travel to the database. (Thus giving them credit for that module). question 2
Any help would be great. I am not very good at code, but trying. My database is Access.So you want to pass some data into Captivate? This can be achieved with a Flash Widget and FlashVars. Basically you would be able to launch a Captivate project on www.google.com/myProject?myVariable=1 and then get the value of myVariable into a Flash widget. The Flash Widget could then pass this variable into Captivate be populating a custom variable that you have definied within Captivate. From that point on you would be able to use the variable in your Captivate project. Google for Flash Vars to see what can be done with it.
As for the other way around - Captivate sending information to your ASP script - that would also require a widget (or perhaps calling a JavaScript function). From the Flash widget you would be able to pass along data from Captivate to an external script and then use it any way you want.
Hope this points you in the right direction.
/Michael
Visit my Captivate blog with tips & tricks, tutorials and Widgets. -
Loading php variables into flash 8
i'm trying to load some vars into flash 8. i tried
loadvariables, loadvariablesnum, loadvars, google. can't figure it
out.
2 years ago when using flash mx trying the same thing, the
line:
loadVariablesNum("file",0);
was enough to do the trick.
but in flash 8 can't get it to work ;(
i have the simplest php file, something like this:
<?
$town = "where";
$person = "who";
$sex = "male";
print "town=$town&person=$person&sex=$sex";
?>
the use of variables is a must, so the solution
print "town=where&person=who&sex=male"
doesn't do me any good. actually this works.
so what's the correct way of loading this into flash 8?
thanks guyz.you can also use a FlashVars= parameter in your
<object><embed> code, IF you are using your PHP code to
also display your flash movie, and if you only need to pass these
variables once when the movie loads. If this is what you need to
do, use this....
<object ...>
....// other params .....
<param name="FlashVars" value="<?
echo var1name;
?>=<?
echo var1value;
?>&<?
echo var2name;
?>=<?
echo var2value;
?>" >
Though you will have to do that in two places, once in the
object code, and once in the embed code.
The embed code would look more like
<embed ...... FlashVars="<? //php similar to above
?>" ..... />
I have used this successfully to pass in variables when the
flash movie first loads, to pass in stuff like a URL for a link and
other info. There are a lot of different ways to pass values in to
flash. You can also use ExternalInterface.call and use Javascript
along with PHP to retrieve info at any time, but that is more
complex.
This may not be what you need - but you can still use
LoadVariables with Flash 8, as well. -
Loading Variables from ASP into Flash
I can find plenty of tutorials detailing how to load
variables from a defined asp page into Flash, but here's my
dilemma...
I have an asp page that is reading a URL with a unique
identifier in it (www.sampleURL.com?id=123456), and then turns the
id number from the URL into a variable. On the same page then, sits
my swf where I need to use LoadVars to pull in that ASP variable
via Actionscript. If I don't have a static asp page to pull the
variables in from and I want to pass the variable within the same
asp page the swf is located on, how do I do it? Many thanks in
advance..."bonzomn65" <[email protected]> wrote in
message
news:ej0630$pjh$[email protected]..
>I can find plenty of tutorials detailing how to load
variables from a
>defined
> asp page into Flash, but here's my dilemma...
>
> I have an asp page that is reading a URL with a unique
identifier in it
> (www.sampleURL.com?id=123456), and then turns the id
number from the URL
> into a
> variable. On the same page then, sits my swf where I
need to use LoadVars
> to
> pull in that ASP variable via Actionscript. If I don't
have a static asp
> page
> to pull the variables in from and I want to pass the
variable within the
> same
> asp page the swf is located on, how do I do it? Many
thanks in advance...
>
You don't need LoadVars for this at all. You can just pass
the variable to
your Flash movie by specifying a query string when you are
calling the
movie.
If you are using the straight object, embed method then it
would look
something like this:
<param name="movie" value="movie.swf?id=11111">
<embed src="movie.swf?id=11111" ... >
If you are using the ActiveContent JavaScript for your movie
then you just
leave off the .swf... so
"name", "movie?id=11111"
Then, in flash you can access the value of id from the _root,
like
var idInFlash:Number = _root.id;
Of course in the above example you would replace 11111 with
the proper
syntax for printing a variable's value in ASP. -
Send variable into flash macromedia
Hi,
I would send a variable into flash macromedia.
I explain my problem. I created an flash wherein i send a word into a variable called lol and i read this varibale in a other variable called dis.
But in labview i dont know how i can send this word into lol and read into dis.
I did many research and i made a .vi who could be functional.
can you help me to see where is my error in this .VI.
Thanks.
Solved!
Go to Solution.
Attachments:
flash and prog.zip 40 KBHi danylolo,
You could use a web service between Flash and LabVIEW to pass your data? You'll certainly have to develop an adapter for Flash.
Romain P.
National Instruments France
#adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
>> NIDays 2011, le mardi 8 février au CNIT de Paris La Défense -
Passing a variable from an html button into flash....
I want to click an html button and send a variable to a swf
file that opens next. I want this variable to go into flash
depending on what the user clicked. I want flash to go to the
english part or to the spanish part of my swf depending on what
this variable is.
How can I do this? Can anyone help me?
Thanks!!!!
Brenda Sanchez.http://www.noscope.com/journal/2003/12/query_string
-
How I can transfer data from the database into a variable (or array)?
I made my application according to the example (http://corlan.org/2009/06/12/working-in-flash-builder-4-with-flex-and-php/). Everything works fine. I changed one function to query the database - add the two parameters and get the value of the table in String format. A test operation shows that all is ok. If I want to display this value in the text area, I simply drag and drop service to this element in the design mode
(<s:TextArea x="153" y="435" id="nameText" text="{getDataMeanResult.lastResult[0].name}" width="296" height="89" />).
It also works fine, just a warning and encouraged to use ArrayCollection.getItemAt().
Now I want to send the value to a variable or array, but in both cases I get an error: TypeError: Error #1010: A term is undefined and has no properties..
How can I pass a value from the database into a variable? Thank you.
public var nameTemp:String;
getDataMeanResult.token = authors.getDataMean(arrayOfNumber[0], dir_id);
nameTemp = getDataMeanResult.lastResult[0].name;
public var nameArray:Array = new Array();
for (var i:uint=o; i<3; i++){
getDataMeanResult.token = authors.getDataMean(arrayOfNumber[i], dir_id);
nameArray[i] = getDataMeanResult.lastResult[0].name;
And how i can use syntax highlighting in this forum?Astraport2012 wrote:
I have to go back to the discussion. The above example works fine when i want to get a single value of the database. But i need to pass an array and get an array, because i want to get at once all the values for all pictures tooltips. I rewrote the proposed Matt PHP-script and it works. However, i can not display the resulting array.
yep, it won't work for Arrays, you'll have to do something slightly more intelligent for them.
easiest way would be to get your PHP to generate XML, then read that into something like an ArrayList on your HTTPService result event (depends what you're doing with it).
for example, you could have the PHP generate XML such as:
<pictures>
<location>test1.png</location>
<location>test2.png</location>
<location>test3.png</location>
<location>test4.png</location>
<location>test5.png</location>
<location>test6.png</location>
</pictures>
then you'll read that in as the ResultEvent, and perform something like this on it
private var tempAC:ArrayList = new ArrayList
protected function getStuff_resultHandler(event:ResultEvent):void
for each(var item:Object in event.result.pictures)
var temp:String = (item.@location).toString();
tempAC.addItem(temp);
in my example on cookies
http://www.mattlefevre.com/viewExample.php?tut=flash4PHP&proj=Using%20Cookies
you'll see an example of how to format an XML structure containing multiple values:
if($_COOKIE["firstName"])
print "<stored>true</stored>";
print "<userInfo>
<firstName>".$_COOKIE["firstName"]."</firstName>
<lastName>".$_COOKIE["lastName"]."</lastName>
<userAge>".$_COOKIE["userAge"]."</userAge>
<gender>".$_COOKIE["gender"]."</gender>
</userInfo>";
else
print "<stored>false</stored>";
which i handle like so
if(event.result.stored == true)
entryPanel.title = "Welcome back " + event.result.userInfo.firstName + " " + event.result.userInfo.lastName;
firstName.text = event.result.userInfo.firstName;
lastName.text = event.result.userInfo.lastName;
userAge.value = event.result.userInfo.userAge;
userGender.selectedIndex = event.result.userInfo.gender;
depends on what type of Array you're after
from the sounds of it (with the mention of picture tooltips) you're trying to create a gallery with an image, and a tooltip.
so i'd probably adopt something like
<picture>
<location>example1.png</location>
<tooltip>tooltip for picture #1</tooltip>
</picture>
<picture>
<location>example2.png</location>
<tooltip>tooltip for picture #2</tooltip>
</picture>
<picture>
<location>example3.png</location>
<tooltip>tooltip for picture #3</tooltip>
</picture>
etc...
or
<picture location="example1.png" tooltip="tooltip for picture #1"/>
<picture location="example2.png" tooltip="tooltip for picture #2"/>
<picture location="example3.png" tooltip="tooltip for picture #3"/>
etc... -
Pass flash variables to server - the best way?
I am using URLVariables at the moment to pass flash variables to the server via php script and update a database rows.
var variables:URLVariables = new URLVariables();
At the moment around 9 variables are sent which are then updated in the mysql db.
I have read that calls to the database via php are the main source of traffic or at least one of them. I am talking about 100 - 500 concurrent users.
Obvously I am going to need expert help medium term but I would like to give things a go myself.
I have read about amfPHP but I don't seem to understand it too well.
Also, I can cut down the amount of php calls per user as I have them all over the place for lots of games and mini exercises.
BUT is it possible to get those nine variables into an object and pass the object. Would one object be faster than passing 9 variables and would that object be placed into one cell of the mysql databse.
What would that look like? At the moment I can read my db easily but if there is an object in there, how do you read that?
Is that what serializning is? Passing an object and all the data is converted to binary etc...
As you see I'm a little lost.
Thanks in advance.Just my two cents.
URLVariables is one of the ways to construct url query. There is no difference in doing it either way (second way is faster):
var request:URLRequest = new URLRequest("http://www.google.com/page.html");
var variables:URLVariables = new URLVariables();
variables.var0 = 3;
variables.var1 = "blah";
request.data = variables;
sendToURL(request);
OR JUST
sendToURL(new URLRequest("http://www.google.com/page.html?var0=3&var1=blah"));
I guess object serialization will be less efficient because, I suspect, it will be a larger string and it is much more processor intensive of both Flash and server side.
I also suspect that http servers have a very efficient way to parse and process requests and variables that come with it - after all this is server's first and the most important duty.
My point is that I don't believe there is anything better than sending data with query string unless there is a need for obfuscation.
As a proof - the fact that large volume and frequent updates sites like advertising servers never use anything but plain old query strings attests to the above points.
As far as DB updates speed goes - it has nothing to do with the means info is sent but rather is a consequence of server and DB performance aspects. It's just a matter of money :-) -
How can I add advertisement code into flash game?
hi mates,
just want to ask about loading advertisement code!
How do you add the advertisement code (adsense) into flash games??
my site Funny Games have over 5k games but they are getting from others sites thus I have no original files. How can I add more code into the current files?Unless the games were pre-made to allow you to specify some variables in the page code or some external file, you won't be having any luck... you cannot add code to the games unless you have the source files, which you apparently don't have.
-
Using Flash Variables in Excelsius
Dear Experts.
I have a dashboard in Xcelsius which has multiple sheets(60 Sheets) where navigation to every other page is done using the push buttons " Back and Next ". This functionality is working fine without creating any issues. Now, the customer wants to print the various sheets at one shot. But, this functionality cant be incorporated in Xcelsius as we can print only one sheet at a time. Hence they decided to use Crystal reports to build the whole functionality again. Now, i thought of a solution where, if we could pass Flash variables for the push buttons from Xcelsius to Crystal reports 2008 and embed this particular SWF into CR, then we could somehow build these different sheets in CR and get the print out at one shot.
Please give me tips on how to use the Flash Variables both in Xcelsius and Crystal Reports.
Thanks in Advance,
KishanHi:
1. For configure flash var under Xceslius designer:
1.1 Open xceslius.
1.2 Click "Manage Connection".
1.3. Choose "Flash Variable".
1.4. Create variable and give name and binding to excel range.
1.5. Export to swf.
2. Consume flash var under crystal report 2008
2.1 Open crystal report.
2.2 Click "Insert Flash Object".
2.3 Browser the swf you just created and add it into crystal report designer.
2.4 Right click the flash object and right click your mouse.
2.5 Choose "Flash Data Expert..."
2.6 Click "+" button to add flash variable. and input your custom data. (note the flash variable name should be the same with defined in swf) -
Get current HTML URL into flash with LoadVars and ColdFusion
I need to get the current page url and pass it into flash.
I'm also using ColdFusion. Is there an easy solution?I gave up on bringing in the URL and parse it into a string,
there is too much I don't understand. I put in two commands in the
HTML where the Flash movie is sitting:
1. <param name="FlashVars" value="airport=sbn"/>
2. and in <embed src I put in, Flashvars="airport=sbn"
"airport" is the variable in Flash (it is called as
"_level0.airport" in the Flash file) and "sbn" is the variable
definition for 12 of the files. I will just find "sbn" and replace
it with the new airport name in the next set. It's not very slick,
but it's better than having to create a new navigation for every
airport. Thanks for the help. -
Flash variable being overridden by hidden value?
--I am doing something painfully simple - My dashboard has a single-cell flash variable; the site. It is located in A1 on the only sheet in the workbook and is a named range/cell. I have gone into connections and set up the Flash Variables connection, pointing it at that named cell. The cell was originally prepopulated with a default value, but that has been cleared and the cell is now empty.
The problem is that when I try to pass my flash variable, using the simplest of all possible HTML, the dashboard immediately switches back to the original default value. NOTHING I pass it will override this value; If I pass it another site name it ignores it.
What should I be looking for here? Is there somewhere that it takes a default entry for the flash variable (other than the field)? If so where? Could it have tucked that default away in a corner somewhere? If so where and how do I get rid of it?--
Nevermind - someone had pulled a selection object off to the side of the page and it was hidden. Found and removed.
Edited by: misanthropic777 on Feb 27, 2009 12:13 AMPost Author: thomas krupa
CA Forum: Xcelsius and Live Office
well, i tried to get the work around mentioned in your link to run. however i get a "document.myMovieName.flashvarobj is not a function" error. i also googled for "flashvarobj", but the one result that is return was of no help either.i am using flash 9, this is my html code<HTML><HEAD><TITLE>test.swf</TITLE></HEAD><BODY><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"codebase="http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" WIDTH="800" HEIGHT="600" id="myMovieName"><PARAM NAME="movie" VALUE="test.swf"> <PARAM NAME="quality" VALUE="high"><PARAM NAME="bgcolor" VALUE="#FFFFFF"><PARAM NAME="play" VALUE="true"><PARAM NAME="loop" VALUE="true"><PARAM NAME=bgcolor VALUE="#FFFFFF"><EMBED src="test.swf" quality=high bgcolor=#FFFFFF WIDTH="800" HEIGHT="600" NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash" play="true" loop="true" PLUGINSPAGE="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT><script> document.myMovieName.flashvarobj("sessionID", 123); document.myMovieName.flashvarobj("Range_0", 41); </script></BODY></HTML> -
Hi example #1 pulls data from a php script into
flash.........my problem is i can't access that data from anywhere
else in the script...........I'd like to somehow make.....username
= myLoadVars.valid; ....variable global.....or make the php data
global so i can access the data from anywhere within the flash
script.
I've tried alot of ways to accomplish
this...._global.....var.....trace from outside the onload
function......every which way you can think of but I always get a
trace output of undefined.......or the data isn't
accessible....Please help...i've given it my best effort.
example#1
var myLoadVars:LoadVars = new LoadVars();
myLoadVars.onLoad = function( success ){
if(success){
username = myLoadVars.valid;
trace(username);
myLoadVars.load('test4.php');the script i have works for me but say i want to trace the
username variable from
the end of the current script......the below example
demonstrates what i mean and the trace output says undefined.....my
problem is I cannot access the username variable from anywhere
except inside the myLoadVars.onLoad function.
var myLoadVars:LoadVars = new LoadVars();
myLoadVars.onLoad = function( success ){
if(success){
username = myLoadVars.valid;
trace(username);
myLoadVars.load('test4.php');
trace(username);
Maybe you are looking for
-
Drill down more than one characteristic at the same time.
Hi, Is there any way to drill down more than one characteristic at the same time? When I drill down by 0cust_sales I would like to have drilled down: division/distrchan/salesorg/cust_sales without having to do that one by one. thank you!
-
How to put a background image in coldfusion page?
Hi all, I have created number of coldfusion pages,i would like to have a background image for them either unique or different images. So i have created a style.css and added a line for background image like background-image: url(/
-
Does Photoshop CS 4 run on Mavericks? How do I get it to run if so?
I am migrating from my MacBook with System X.6.8 and Photoshop CS 4 to a new MacBook Pro computer running System X.9.1 I have copied Photoshop CS 4 over, but it does not run. I copied all of the System files I could figure out becaue I could not find
-
Message split on adapter engine for the java based IDoc adapter
Hi Guys, Do you know if message split on adapter engine is available for the java based IDoc adapter on the single stack (PI 7.31)? I'm getting such exception when I try to post 3 IDocs Transmitting the message to endpoint <local> using connection Fi
-
Issues while processing the BOMs using fm ''CSAP_MAT_BOM_MAINTAIN'
Hi Group, we are facing issues while processing the BOMs using the basic type(Z-idoc type) for standard type BOMMAT04. thing is that the segment 'E1STPOM' is defined to contain 1 to 99999 records in it. when an Idoc is run(say with 150/200 segments o