How to pass a variable from HTML to Flash 9
I have built my flash ad banner in Flash 9 and now want the
HTML code to pass the url over to the flash movie that it should
jump to when clicked.
The info in the help file seems out of date for the latest
HTML template as it uses mainly JavaScript to get round IE's
dreadful embeding issue. So my problem is, how do I pass a variable
from the HTML to the actionScript specified int he Help file
(running on a full screen button) as shown below?
myButton_btn.onRelease = function() {
if (clickTAG.substr(0, 5) == "http:") {
getURL(clickTAG);
via the html code now used by Flash 9 which is like this:
<!-- saved from url=(0013)about:internet -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Advert_long</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 = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 115;
// -->
</script>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<!--
Coping
with
Growing
Audio
Series
Theraputic stories
for children aged
4 to 9
-->
<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=9,0,115,0',
'width', '120',
'height', '600',
'src', 'Advert_long',
'quality', 'high',
'pluginspage', '
http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'Advert_long',
'bgcolor', '#ffffff',
'name', 'Advert_long',
'menu', 'true',
'allowScriptAccess','sameDomain',
'allowFullScreen','false',
'movie', 'Advert_long',
'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>
// Provide alternate content for browsers that do not
support scripting
// or for those that have scripting disabled.
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>
</noscript>
</body>
</html>
You should use SWFObject to embed your Flash. Not only does
it make
embedding more straightforward, it makes passing query
parameters very easy.
Check out:
http://code.google.com/p/swfobject/
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/
Similar Messages
-
How to pass a variable from HTML to Flash
I have built my flash ad banner in Flash 9 and now want the
HTML code to pass the url over to the flash movie that it should
jump to when clicked.
The info in the help file seems out of date for the latest
HTML template as it uses mainly JavaScript to get round IE's
dreadful embeding issue. So my problem is, how do I pass a variable
from the HTML to the actionScript specified int he Help file
(running on a full screen button) as shown below?
myButton_btn.onRelease = function() {
if (clickTAG.substr(0, 5) == "http:") {
getURL(clickTAG);
via the html code now used by Flash 9 which is like this:
<!-- saved from url=(0013)about:internet -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Advert_long</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 = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 115;
// -->
</script>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<!--
Coping
with
Growing
Audio
Series
Theraputic stories
for children aged
4 to 9
-->
<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=9,0,115,0',
'width', '120',
'height', '600',
'src', 'Advert_long',
'quality', 'high',
'pluginspage', '
http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'Advert_long',
'bgcolor', '#ffffff',
'name', 'Advert_long',
'menu', 'true',
'allowScriptAccess','sameDomain',
'allowFullScreen','false',
'movie', 'Advert_long',
'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>
// Provide alternate content for browsers that do not support
scripting
// or for those that have scripting disabled.
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>
</noscript>
</body>
</html>You should use SWFObject to embed your Flash. Not only does
it make
embedding more straightforward, it makes passing query
parameters very easy.
Check out:
http://code.google.com/p/swfobject/
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/ -
Passing dynamic variable from html to Flash
I know this is pretty simple but all that I have read doesn't make much sense to me. I have one swf calling another swf that I have embedded into an htnl. In other words just calling another html page in a seperate window.
In one.swf (runing in broswer) I use the below to call another html page passing the variable NewLessonArray. This contains an array of completed chapters.
// LOADING URL
var NewLessonCompleteArray:String = LessonCompleteArray.toString();
navigateToURL(new URLRequest("two/index.html?CurrentLessonInfo=<NewLessonCompleteArray>"), "_blank");
In the receiving swf I want to retrieve the passing parameters.
two.swf
// Getting the parameters passed
this.loaderInfo.parameters.toString()
All that is returned that I can see is object Object. But since I am passing on a address line into another swf embedded in a html page I am unable to determine that correct syntac for retrieving the information.
Any suggestions? This has got to be pretty simple... I think.
THANKSWhat you are trying to do is not extremely difficult to do, but it is not something I would consider as being simple. With Andrei's approach you should be able to take the url String and dissect the parameters from it using String methods, like split().
As for the loaderInfo end of things, you are not passing the parameters to the swf file, you are passing them to the html page. So the loaderInfo won't have any info for you regarding the url parameters. The loadInfo would typically get parameters via the FlashVars parameters passed in in the html's swf embedding code.
Here are some other solutions that you might consider. I have not dealt with these myself, they are merely in my collection of useful info, so you might have to experiment to get them working. One is a link to a class-based approach and the other is an approach that use swfObject embedding to dynamically add the parameters as FlashVars to the embedding code....
http://mikethenderson.com/2009/02/as3-return-query-string-value-version-2/#more-105
OR
In your HTML:
var flashvars = {};
if (swfobject.getQueryParamValue("aParameter")) {
flashvars.param = swfobject.getQueryParamValue("aParameter");
swfobject.embedSWF("myMovie.swf", "myContent", "550", "400", "9.0.0", "", flashvars);
And the param variable will be available as a FlashVar to your movie:
var theParam = loaderInfo.parameters.param; -
How to pass a variable from one class to another class?
Hi,
Is it possible to pass a variable from one class to another? For e.g., I need the value of int a for calculation purpose in method doB() but I get an error <identifier> expected. What does the error mean? I know, it's a very, very simple question but once I learn this, I promise to remember it forever. Thank you.
class A {
int a;
int doA() {
a = a + 1;
return a;
class B {
int b;
A r = new A();
r.a; // error: <identifier> expected. What does that mean ?
int doB() {
int c = b/a; // error: operator / cannot be applied to a
}Thank you!elaine_g wrote:
I am wondering why does (r.a) give an error outside the method? What's the reason it only works when used inside the (b/r.a) maths function? This is illegal syntax:
class B {
int b;
A r = new A();
r.a; //syntax error
}Why? Class definition restricts what you can define within a class to a few things:
class X {
Y y = new Y(); //defining a field -- okay
public X() { //defining a constructor -- okay
void f() { //defining a method -- okay
}... and a few other things, but you can't just write "r.a" there. It also makes no sense -- that expression by itself just accesses a field and does nothing with it -- why bother?
This is also illegal syntax:
int doB() {
A r = new A();
r.a; // error: not a statement
}Again, all "r.a" does on its own is access a field and do nothing with it -- a "noop". Since it has no effect, writing this indicates confusion on the part of the coder, so it classified as a syntax error. There is no reason to write that. -
Passing a variable from text to flash
How do you pass a variable from a text file to flash?
Check out Help for loadVariables.
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/ -
ADF : How to pass a variable from one frame to another frame ?
Hi,
I have an html page divided into 3 frames, all inside a frameset. Each frame are linked to a specific .jsf page (src attribute). When I list a list thanks to a ADF datatable in ONE frame, each row has a "show more" button. When I click this button I succeeded to print row detail inside the same frame thanks to the processScope ADF's native variable. The problem is that I want to display the row detail in another frame, clicking from this current frame. So for this I need to reload the other frame which display the content of the processScope variable.
For this I use the javascript code :
=> parent.frames['bottomRight'].location.reload()
Just before refreshing, I put the variable in the processScope of course like it appears in the backing bean :
FacesContext context = FacesContext.getCurrentInstance();
CLPRMBuilding building = (CLPRMBuilding)
context.getApplication().getVariableResolver().resolveVariable(context, "building");
if (building == null)
return "error";
AdfFacesContext afContext = AdfFacesContext.getCurrentInstance();
afContext.getProcessScope().put("buildingDetail", building);
Next, when the user click on the button "show more" a binding CoreCommandButton component is done. And the accessor's code is executed :
public void setShowMoreCommandButton(CoreCommandButton showMoreCommandButton) {
this.showMoreCommandButton = showMoreCommandButton;
showMoreCommandButton.setOnclick("parent.frames['bottomRight'].location.reload()");
And so the other frame is reloaded ! But the "buildingDetail" variable seems not to be present in the processScope because in the jsf page displayed by the other frame no content is printed, like if the variable were not initialized. How to do then ? How to pass the buildingDetail variable to the other frame which I need to reload to refresh it's content ?elaine_g wrote:
I am wondering why does (r.a) give an error outside the method? What's the reason it only works when used inside the (b/r.a) maths function? This is illegal syntax:
class B {
int b;
A r = new A();
r.a; //syntax error
}Why? Class definition restricts what you can define within a class to a few things:
class X {
Y y = new Y(); //defining a field -- okay
public X() { //defining a constructor -- okay
void f() { //defining a method -- okay
}... and a few other things, but you can't just write "r.a" there. It also makes no sense -- that expression by itself just accesses a field and does nothing with it -- why bother?
This is also illegal syntax:
int doB() {
A r = new A();
r.a; // error: not a statement
}Again, all "r.a" does on its own is access a field and do nothing with it -- a "noop". Since it has no effect, writing this indicates confusion on the part of the coder, so it classified as a syntax error. There is no reason to write that. -
How to pass a variable from one scene to another
I'm making a call from one scene to another via a button, but I have two buttons calling the same scene, each for a different purpose, and I need to pass certain variables tied to each button to that called scene. How can I do this?
import flash.events.MouseEvent;
stop();
var nam:String="test";
testscene2.addEventListener(MouseEvent.CLICK,fn);
function fn(e:MouseEvent){
nam="Raja";
gotoAndStop(1,"Scene 3");
testscene1.addEventListener(MouseEvent.CLICK,fn1);
function fn1(e:MouseEvent){
nam="Emily";
gotoAndStop(1,"Scene 2"); -
How to pass query parameter from HTML in SAP XMII
I need to pass the value to query parameter from html .i m quite confused about how to do that .can anyone give me a valid point....
Ramesh,
Addition of Rupesh,
U can also pass in the form of INLINE paramters.
Like
<Applet name = <appletname> width .......>
<param NAME = "param.1" VALUE = <value>
<param NAME= "param.2" VALUE = " <value>
</APPLET>
Thanks
Hari -
Instead of using session How to pass the variable from action class to JSP
Im using Struts1.2 version.Created the Sample application to get the username.Upto action class im getting the username then i have to display the username in the JSP.Is there any options rather than using session variable to display the username.
did you check the answer in your previous thread
Passing Variable from Javascript to Controller -
Can't receive variables from HTML to Flash in AS3 passed via URL (not Flashvars)
hey all,
can't seem to get AS3 to recognize variables passed via URL
(not Flashvars). i can get vars passed with Flashvars in the
javascript but I don't want to use that method. i'm simply
extending the .swf call with .swf?var=123 in the embed and on the
AS3 side i'm calling loaderInfo.parameters.var
thought this would work but doesn't. what am i doing wrong?
HTML:
<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="1024" height="768" id="main" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="main.swf?var=123"
/><param name="quality" value="best" /><param
name="bgcolor" value="#ffffff" /> <embed
src="main.swf?var=123" quality="best" bgcolor="#ffffff"
width="1024" height="768" name="main" align="middle"
allowScriptAccess="sameDomain" allowFullScreen="false"
type="application/x-shockwave-flash" pluginspage="
http://www.macromedia.com/go/getflashplayer"
/>
</object>
AS:
t = new TextField();
t.text = String(loaderInfo.parameters.var);
thx in adv.
michaelappreciate you were going for brevity, but i think the
answer's going to be hidden either in your complete html code or
your complete AS code. without seeing this i can only keep
guessing.
that said, my latest guess is that you're not passing your
variable within the AC_FL_RunContent function. there are two
properties set in this function - src and movie, which contain your
movie name, to which you can add any parameters you wish to pass.
eg.
'src', 'main?var=123',
'movie', 'main?var=123',
where main is the name of your swf and var the name of the
parameter you wish to pass.
if this function fails - if javascript isn't available in the
browser, for example, or AC_RunActiveContent.js is missing, then
the <object> tag you described is used. (this object tag is
sitting inside a <noscript> tag.) -
Passing a variable from html to java
I'm trying to pass a value from a coldfusion page to an applet.
ThanksI'm trying to pass a value from a coldfusion page to
an applet.
ThanksGood luck! So what part of the code is the problem, or what exactly is your question? -
Extremely URGENT! How to pass a parameter from html to form?
Hi Guys,
I want to be able to pass a parameter to a Pre-Query trigger (from a html page to an Oracle form.) Right now, I hard coded the Pre-Query trigger
(i.e. set_block_property('datablock_name', default_where, 'tableName.fieldName = '||:datablock.field)
I want to be able to assign a value to the above datablock.field from an URL (i.e. something like http://localhost/dev60cgi/ifcgi60.exe?form=MODULE1.fmx&userid=&otherparams=fieldx=parameterSample
Does anyone know how to set that up within Oracle Forms. Thanks in advance.Hello. your you can create one it paginates similar to this...
<HEAD></HEAD>
<BODY >
<!-- Forms applet definition (start) -->
<OBJECT classid="clsid:86ecb6a0-400a-11d5-b638-00c04faedb18" codebase="/jinitiator/jinit.exe#Version=1,1,8,11" WIDTH="950" HEIGHT="560" HSPACE="0" VSPACE="0">
<PARAM NAME="TYPE" VALUE="application/x-jinit-applet;version=1.1.8.11">
<PARAM NAME="CODEBASE" VALUE="/forms60java/">
<PARAM NAME="CODE" VALUE="oracle.forms.engine.Main" >
<PARAM NAME="ARCHIVE" VALUE="f60all_jinit.jar, ComponentesEsigfa.jar" >
<PARAM NAME="serverPort" VALUE="9000">
<PARAM NAME="serverHost" VALUE="MyServer">
<PARAM NAME="serverURL" VALUE="/servlet/oracle.forms.servlet.ListenerServlet?ifcfs=/servlet/f60servlet?config=servlet&form=fca_menu.fmx&otherparams=ejercicio=<%=request.getParameter("ejercicio")%>&useSDI=yes&lookAndFeel=generic&colorSchema=teal">
<PARAM NAME="connectMode" VALUE="HTTP">
<PARAM NAME="serverArgs"
VALUE="module=fca_menu.fmx userid=<%= request.getParameter("login")+"/"+request.getParameter("pwd")+ "@" +request.getParameter("base")%> ejercicio=<%=request.getParameter("ejercicio")%>">
<PARAM NAME="separateFrame" VALUE="false">
<PARAM NAME="splashScreen" VALUE="no">
<PARAM NAME="backgroun[i]Long postings are being truncated to ~1 kB at this time. -
Passing variable from html to flash
Hi I have built a flash movie with buttons...depending on
which button is clicked it loads a different flash movie due to
variable setting. I am able to set and call the variable s in flash
fine
But now i have an html page that needs to blend with this
flash...So i created buttons on my html page to look like the
flash...But when i click a certain button i want it to know the
variable going into the flashpage and load correct movie...not just
go to the beginning of my flash movie then user will have to choose
the button again...
How can i do this?
thank you in advance
renowell, between the post to forum and this link below i got
this to work for me
Just needed to know about the javascript....along with
putting the value/variable in url as posted..thanks
http://noscope.com/journal/2003/12/query_string
thanks for replying with suggestions!
reno -
How to pass a variable from one form to another in Form 6i
I have a user-password screen in one form. And every module has separate form. I need to pass user-name and user-level to all the form.
I am using Form 6i and Oracle 8.
Thanx in advance
VikasDECLARE
PL_ID PARAMLIST;
BEGIN
pl_id := GET_PARAMETER_LIST(:your parameter name);
IF ID_NULL(PL_ID) THEN
PL_ID := CREATE_PARAMETER_LIST(:your parameter name);
ELSE
DESTROY_PARAMETER_LIST(PL_ID);
PL_ID := CREATE_PARAMETER_LIST(:your parameter name);
END IF;
ADD_PARAMETER(PL_ID,your variable,TEXT_PARAMETER,:PARAMETER.your parameter name);
call_form ('Your Fmx Here',HIDE,NO_REPLACE,NO_QUERY_ONLY,PL_ID);
END;
hope this will help...
regrds
Kris -
How to pass a variable from se38 prog to script.
hi ,
my requirement is for billing.
what i need to do is if kona-zlsch = 'T', then i have to set a flag = 'X'.
i want to know that how i will pass this flag value to my script ?
plz can any one help me.
thanks
SantosiniSAP script:
select the window in which u want to display the varibale.
go to edit->text elements
then goto->change editor
first column select /:
then mention &FLAG&.
main program:
call functions: 1. open_form
2. write_form
3. close_form
Maybe you are looking for
-
How do I stop Final Cut Pro 10.1 from introducing artifacts?
How do I stop Final Cut Pro 10.1 from introducing artifacts? Can someone please tell me what do do differently so that my edited video does not develop artifacts that were not in the original camera file. My Sony HDR CX900 produces crazy detailed XA
-
How do you change the name displayed on airdrop? It is showing the wrong name. I'm am using an iPod touch 5th generation.
-
Hello Everyone, Issue: PDF not loading on first click but loads properly on refreshing the same page. Scenario: I am creating a PDF using PDF action blocks and calling the PDF on click of a button. On click of button, I am calling the following url f
-
TI SmartView doesn't run since the last Mac OS X update
Hi everybody, I currently use TI SmartView (Interactiv Emulator for TI Calcs) with my pupils. Since the last update of Mac OS X (my macbook runs with 10.6.5 version), TI SmartView doesn't run and I have the following message which appears: +Process:
-
OSB with a (non-supported) virtual tape library
For testing and learning purposes, I have installed OSB 10.3 and the virtual tape management system mhvtl (http://mhvtl-linux-virtual-tape-library-community-forums.966029.n3.nabble.com/MHVTL-Linux-Virtual-Tape-Library-Getting-Started-td1663811.html).