ExternalInterface to Javascript/Html Issue
AdobeTV showed a way to allow Flash to "talk" to an HTML page via javascript using the ExternalInterface method. There seems to be a catch. You need to use the ID of the swf in the parameters to have it all fit together and you can only put the ID="swf" into the IE section of the Dreamweaver generated javascript or into the non-IE section. Putting it in both didn't work and the author mentioned only putting in one of them specifically.
Is there a way to do this that would work in both sets of generated Javascript?
use:
import ....ExternalInterface;
ExternalInterface.call("yourJSfunction",<parameters>);
Similar Messages
-
JavaScript/HTML notification problem
Below problems are in JavaScript/HTML only. In Flex both works well.
In JavaScript/HTML on Mac, dock icon bounces only once in CRITICAL.
Below 3 cases(type, CRITICAL, "aaa"), same results.
How do I use JavaScript code to react doc icon repeatedly?
function notify() {
if (air.NativeApplication.supportsDockIcon) {
var critical = document.getElementById("critical");
var type = (critical.checked ? air.NotificationType.CRITICAL : air.NotificationType.INFORMATIONAL);
//air.NativeApplication.nativeApplication.icon.bounce(type);
//air.DockIcon(air.NativeApplication.nativeApplication.icon).bounce(air.Notific ationType.CRITICAL);
air.NativeApplication.nativeApplication.icon.bounce("aaa");
function setListener()
nativeWindow.addEventListener(air.Event.DEACTIVATE, notify);
</script>
</head>
<body onload="setListener()">
And I have another problem on Windows just as Mac.
Below cases(type, CRITICAL, ,no argumens) are same results.
Application windows and taskbar flash only once.
How do I use JavaScript code to flash window and taskbar??
function notify(){
if(air.NativeApplication.supportsSystemTrayIcon && air.NativeWindow.supportsNotification) {
var critical = document.getElementById('critical');
var type = (critical.checked ? air.NotificationType.CRITICAL : air.NotificationType.INFORMATIONAL);
window.nativeWindow.notifyUser(type);
//window.nativeWindow.notifyUser(air.NotificationType.CRITICAL);
//window.nativeWindow.notifyUser();
function setListener(){
window.nativeWindow.addEventListener(air.Event.DEACTIVATE, notify);
</script>
</head>
<body onLoad="setListener()">I've got the same problem.
Using Javascript/HTML the icon only bounces once in OS X and the system tray doesn't even highlight in Windows XP Pro for me.
I have also tried every permutation of use for:
air.NativeApplication.nativeApplication.icon.bounce(air.NotificationType.CRITICAL);
-- and --
air.NativeApplication.stage.nativeWindow.notifyUser(air.NotificationType.CRITICAL);
And still nothing works as you describe in:
http://help.adobe.com/en_US/AIR/1.5/devappshtml/WS5b3ccc516d4fbf351e63e3d118666ade46-7dcd. html
-- and --
http://help.adobe.com/en_US/AIR/1.5/devappshtml/WS5b3ccc516d4fbf351e63e3d118666ade46-7dcb. html
any suggestions as to how I can overcome this issue would be appreciated. -
Can I use JavaScript HTML Portlet and PDK Portlets
Can I use JavaScript HTML Portlet and PDK Portlets?
My Script works fine with the an HTML portlet but it always gives a an Error Message in the status bar is that normal...
Other then that I have JavaScript in my PDK portlet page it does not work.. it is the the same javascript I use for in my HTML portlet which works in HTML portlets..You'll have to place your JavaScript in the header section of your Portal page. To do so, use HTML/UI templates. For more information, refer to the How to Design and Build Compelling Portal Interfaces whitepaper.
Good luck,
Peter -
Hi there!
I'm trying to utilize the "anything slider" via the html widget on my welcome page. I've got all of my files properly located, I think my issue is with the html working correctly in iweb. The original html code opens up a beautiful slider and when placed into an html snippet on my welcome page it's all wacked out and images are not displayed properly.
Here is my html that I'm working with:
Original file: http://dl.dropbox.com/u/29215513/slider_original.html
MY file: http://dl.dropbox.com/u/29215513/slider-edit_this_one.html
Any help would be appreciated as soon as possible, as I'm trying to update this for a job interview... I feel like I'm losing my mind or iweb just decided to hate my guts.
Thanks! JYou didn't follow the instructions. You skipped a step. You need to correct the links for iWeb.
You need to add you MobileMe info "http://YOURMobileMe.com/"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Jen Slides</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Jen Slides" />
<meta name="description" content="Jen Slides" />
<!-- Start WOWSlider.com HEAD section -->
<link rel="stylesheet" type="text/css" href="http://YOURMobileMe.com/engine1/style.css"/>
<style type="text/css">a#vlb{display:none}</style>
<script type="text/javascript" src="http://YOURMobileMe.com/engine1/jquery.js"></script>
<script type="text/javascript" src="http://YOURMobileMe.com/engine1/wowslider.js"></script>
<!-- End WOWSlider.com HEAD section -->
</head>
<body style="background-color:#d7d7d7">
<!-- Start WOWSlider.com BODY section -->
<div id="wowslider-container1">
<div class="ws_images">
<span><img src="http://YOURMobileMe.com/data1/images/1.jpg" alt="1" title="1" id="wows0"/></span>
<span><img src="http://YOURMobileMe.com/data1/images/2.jpg" alt="2" title="2" id="wows1"/></span>
<span><img src="http://YOURMobileMe.com/data1/images/3.jpg" alt="3" title="3" id="wows2"/></span>
<span><img src="http://YOURMobileMe.com/data1/images/4.jpg" alt="4" title="4" id="wows3"/></span>
<span><img src="http://YOURMobileMe.com/data1/images/5.jpg" alt="5" title="5" id="wows4"/></span>
<span><img src="http://YOURMobileMe.com/data1/images/6.jpg" alt="6" title="6" id="wows5"/></span>
<span><img src="http://YOURMobileMe.com/data1/images/7.jpg" alt="7" title="7" id="wows6"/></span>
<span><img src="http://YOURMobileMe.com/data1/images/8.jpg" alt="8" title="8" id="wows7"/></span>
<span><img src="http://YOURMobileMe.com/data1/images/9.jpg" alt="9" title="9" id="wows8"/></span>
<span><img src="http://YOURMobileMe.com/data1/images/10.jpg" alt="10" title="10" id="wows9"/></span>
<span><img src="http://YOURMobileMe.com/data1/images/11.jpg" alt="11" title="11" id="wows10"/></span>
</div>
<div class="ws_bullets"><div>
<a href="#wows0" title="1">1</a>
<a href="#wows1" title="2">2</a>
<a href="#wows2" title="3">3</a>
<a href="#wows3" title="4">4</a>
<a href="#wows4" title="5">5</a>
<a href="#wows5" title="6">6</a>
<a href="#wows6" title="7">7</a>
<a href="#wows7" title="8">8</a>
<a href="#wows8" title="9">9</a>
<a href="#wows9" title="10">10</a>
<a href="#wows10" title="11">11</a>
</div></div>
<a style="display:none" href="http://wowslider.com">jQuery Slider Examples by WOWSlider.com v2.0.3m</a>
<div class="ws_shadow"></div>
</div>
<script type="text/javascript" src="http://YOURMobileMe.com/engine1/script.js"></script>
<!-- End WOWSlider.com BODY section -->
</body>
</html> -
Javascript coding issues (if else statements)
Hello to all,
I am posting for help for problems I am having with javascript. The website is www.goshowpro.com. Right now on the website it is connected by multiple html files but I would like to have it all on one single page with the animations responding. I would like the animation to be seamless but I am relatively new to javascript and am having issues with my syntax I believe. Below is the code for my new home page/index button. Thank you for your help in advance.
-Michael
if (mymovie == "hporstop"){
// play the timeline from the given position (ms or label)
sym.play("phomstart");
else if (mymovie == "por1.1stop"){
// play the timeline from the given position (ms or label)
sym.play("phomstart");
else if (mymovie == "por1.2stop"){
// play the timeline from the given position (ms or label)
sym.play("phomstart");
else if (mymovie == "por1.3stop"){
// play the timeline from the given position (ms or label)
sym.play("phomstart");
else if (mymovie == "sporstop"){
// play the timeline from the given position (ms or label)
sym.play("phomstart");
else if (mymovie == "cporstop"){
// play the timeline from the given position (ms or label)
sym.play("phomstart");
else if (mymovie == "hconstop"){
// play the timeline from the given position (ms or label)
sym.play("chomstart");
else if (mymovie == "sconstop"){
// play the timeline from the given position (ms or label)
sym.play("chomstart");
else if (mymovie == "pconstop"){
// play the timeline from the given position (ms or label)
sym.play("chomstart");
else if (mymovie == "cserstop"){
// play the timeline from the given position (ms or label)
sym.play("shomstart");
else if (mymovie == "hserstop"){
// play the timeline from the given position (ms or label)
sym.play("shomstart");
else (mymovie == "pserstop"){
// play the timeline from the given position (ms or label)
sym.play("shomstart");Hi Mike,
When you test the different possible values of a variable mymovie, you are better off using a switch.
See : http://www.w3schools.com/js/js_switch.asp
Then you could avoid repeating statements by regrouping cases :
switch( mymovie)
case "hporstop":
case "por1.1stop":
case "por1.2stop":
case "por1.3stop":
case "sporstop":
case "cporstop":
sym.play("phomstart");
break;
case "hconstop":
case "sconstop":
case "pconstop":
sym.play("chomstart");
break;
case "cserstop":
case "hserstop":
case "pserstop":
sym.play("shomstart");
break;
What is important to grasp to understand the flow of execution is that the break; statement prevents from testing the following cases.
Gil -
ExternalInterface Call Javascript Array to AS2 throwing undefined error
I need to pass various (tracking) IDs to a .swf. the IDs are in an array like this =
<script type="text/javascript">
function getImpID() {
var medID={impID:'12345',pvID:'677890',exID:'654332'};
return medID;
function thisMovie(banner) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[banner]
else {
return document[banner]
window.onload=getImpID;
</script>
Right now the AS2 I have is:
import flash.external.*;
System.security.allowDomain(sourceDomain)
var allID:String = ExternalInterface.call.apply("getImpID");
function getIDs(){
var impID:Number;
var pvID:Number;
var exID:Number;
var id_arr:Array = allID.split(",");
_root.id_test.text = impID;
getIDs();
Basically what I need is to split the three ID's from the javascript so that I can append them with various URL clickTags in the AS. Main issue I have is the 'undefined' error, so I'm going out on a limb here that the AS2 I have doesn't do anything right now of value. Biggest head scratcher for me is, if I have the IDs in an array in the javascript (medID) how to get them not only properly into Flash but to separate them into their separate IDs.
Any suggestions would be greatly appreciated.
Thanks!Forgot to reply, your guidance helped in solving the riddle =
actionscript:
function idTag(){
getID = Object(ExternalInterface.call("getImpID"));
getID.toString();
//_root.id_test.text = getID;
idTag();
javascript
<script type="text/javascript">
function getImpID() {
var getID=['impID=8910424942498409873&pvID=8910423767061585831'];
thisMovie("banner").getID;
return getID;
function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName]
else {
return document[movieName]
</script>
worked like a charm! -
Hi,
I have embedded a video and an image gallery on my mobile site (WIP) using the insert html (each inserted separately) . I am having a strange issue where after viewing the photo
gallery the video from vimeo becomes static and the play button does nothing! If I refresh the page the video becomes active!? Its only when viewing the gallery that this happens.
Any Ideas will be greatly appreciated.
Thankshave you tried opening your html in a web browser? it should work in Safari. Next open the html web page using an iPad. if the page works in Safari on an iPad it should work in an iBook.
There are many JavaScript codes that will not work in iBooks - including webgl.
hope this helps... -
ExternalInterface Security: JavaScript/SWF Cross Domain
I've been developing a small video enchanced application that
allows the developer to communicate with an API via JavaScript. I'm
using ExternalInterface to register all the necessary callbacks.
I would like to host the SWF on one of our static media
servers, but allow the SWF to be utilized on any number of domains.
However, I discovered a problem while setting up a demo on our
wiki. It appears that I'm getting a Security Sandbox violation
describing that "SecurityDomain '
http://idocs.domainA.com/bin/view/IDocs/FLVDevShed'
tried to access incompatible context '
http://cfdev.domainB.com/Staff/jgiotta/mediaplayer/mediaplayer.swf'".
Can this be solved by placing a
crossdomain.xml on the wiki domain (or any domain)?
Currently, I've hardcoded
"System.security.allowDomain('.')" into the app to fix this
problem, is this safe?Followup: ExternalInterface worked as advertised here. The
problem was that I hadn't written the second html param for
'allowScriptAccess' after the embed tag. (I had mistakenly thought
it to be redundant. It wasn't. -
Pass a value from a PL/SQL function to a javascript (html header) ? ?
Hey Guys,
Have a question regarding how to pass a value from a PL/SQL function to a javascript in the HTML Header.
I have created a PL/SQL function in my database, which does looping.
The reason for this is: On my apex page when the user selects a code, it should display(or highlight buttons) the different project id's present for that particular code.
example= code 1
has project id's = 5, 6, 7
code 2
has project id's = 7,8
Thank you for your Help or Suggestions
Jesh
The PL/SQL function :
CREATE OR REPLACE FUNCTION contact_details(ACT_CODE1 IN NUMBER) RETURN VARCHAR2 IS
Project_codes varchar2(10);
CURSOR contact_cur IS
SELECT ACT_CODE,PROJECT_ID
FROM ACTASQ.ASQ_CONTACT where ACT_CODE = ACT_CODE1;
currec contact_cur%rowtype;
NAME: contact_details
PURPOSE:
REVISIONS:
Ver Date Author Description
1.0 6/25/2009 1. Created this function.
BEGIN
FOR currec in contact_cur LOOP
dbms_output.put_line(currec.PROJECT_ID || '|');
Project_codes := currec.PROJECT_ID|| '|' ||Project_codes;
END LOOP;
RETURN Project_codes;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
-- Consider logging the error and then re-raise
RAISE;
END contact_details;
/Jesh:
I have made the following modifications to your app to get it to work as I thing you need it to.
1) Changed the source for the HTML Buttons Region(note use of id vs name for the Buttons)
<script>
function hilitebtn(val) {
//gray buttons
$x('graduate').style.backgroundColor='gray'
$x('distance').style.backgroundColor='gray'
$x('career').style.backgroundColor='gray'
$x('photo').style.backgroundColor='gray'
//AJAX call to get project-ids
var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=GETPROJECTS',0);
get.addParam('x01',val)
gReturn = get.get();
var arr=gReturn.split(':'); //dump into array
get = null;
for (i=0;i<arr.length;i++) {
// alert('val=' + arr);
if ( arr[i]==5)
$x('graduate').style.backgroundColor='red';
if ( arr[i]==6)
$x('distance').style.backgroundColor='red';
if ( arr[i]==7)
$x('career').style.backgroundColor='red';
if ( arr[i]==8)
$x('photo').style.backgroundColor='red';
</script>
<table cellpadding='0' cellspacing='0' border='0'>
<tr><td>
<input type='button' id='graduate' value='Graduate'>
</td>
<td>
<input type='button' id='distance' value='Distance'>
</td>
<td>
<input type='button' id='career' value='Career/Tech'>
</td>
<td>
<input type='button' id='photo' value='Photos'>
</td>
</tr></table>
2) Defined the application process GETPROJECTS as DECLARE
IDS varchar2(1000);
l_act_code varchar2(100) :=4;
begin
IDS:='';
l_act_code := wwv_flow.g_x01;
for x in(
SELECT ACT_CODE,PROJECT_ID
FROM ASQ_CONTACT
where ACT_CODE = l_act_code)
LOOP
IDS := IDS || X.PROJECT_ID|| ':' ;
END LOOP;
HTP.PRN(IDS);
END;
3) Changed the 'onchange' event-handler on p1_act_code to be 'onchange=hilitebtn(this.value)'
4) Added the JS to the HTML Page Footer <script>
hilitebtn($v('P1_ACT_CODE'));
</SCRIPT> -
I've been teaching myself Java on and off for the past couple years with the help of these forums and other tutorials. Now I've decided to take on a project that requires the use of HTML and Javascript and I can't seem to find the information I need. I was hoping that somebody from these forums could either answer my questions and/or point me in the right direction to find the answers.
The project is simple. I created an HTML window with an inputTextArea, an outputTextArea, and two buttons (Submit and Reset). When Submit is pressed I need the program to take the text from inputTextArea one line at a time, check the indexOf a string, and add tags at the beginning and end of the string if it meets certain criteria before appending it to outputTextArea.
I can (and have) written this very easily in Java but I can't seem to find the methods I need in Javascript. In java I use a java.io LineReader to read the inputTextArea.getText() one line at a time and then make the changes as needed. I actually can't even find a tutorial in Javascript that can explain how to take the text from inputTextArea and print it into outputTextArea.
So the main thing I need to know is how to read one line of text at a time from the inputTextArea. I think I can figure the rest out.That was actually my original thought when I started on the Java version of the program but I couldn't figure out how to enter the the carriage return in as a variable to be indexed. So it wasn't until after I found the LineReader that I was able to complete the Java version.
Is there some way to enter the carriage return in as a searchable variable? -
Adobe Edge Animate JavaScript Coding issues/page load time speeds
To let you have an idea of my skill set I have a background in animation and design and have been taking classes in web development. My question is about how to create an interactive website that loads various animation depending on the user's choice and current place within the Adobe Edge Animate timeline. The website I developed for a client @ www.goshowpro.com works but loads slower than I want and doesn't format properly on my client's Macbook (I believe he needs to update his browsers but that is something else.)
So as you can see from looking at my website I used a multitude of HTML files to create my vision of an interactive website based off of a theatrical stage. I know this is not an ideal method. I would prefer to have it all on one page but I am having trouble with my javascript coding. I was wondering if there would be away to expedite my current site's load time and if not if you could look at my NEW coding. (This IS NOT the current coding on the site.)
if = "hstop" "chomstop" "shomstop" "phomstop"
{sym.play("hporstart")};
else = "hconstop" "sconstop" "pconstop"
{sym.play("cporstart")};
else = "hserstop" "cserstop" "pserstop"
{sym.play("sporstart")};
It looks crappy but I'm trying to learn so don't laugh too much. Thanks again.
MichaelHi, Marlene-
We currently bundle jQuery 1.7.1 with the Animate runtime. In order to call fadeOut() on the element newSquare, you would do the following:
sym.$("newSquare").fadeOut();
OR
sym.getSymbol("newSquare").getSymbolElement().fadeOut();
Hope that helps!
-Elaine -
Will Adobe AIR apps work on iOS (Javascript/HTML)?
Hello,
I haven't been able to find any definitive answer on whether Adobe AIR apps using Javascript and HTML can work on iOS.
Anyone know for sure?
And if so, what happens with the APIs available through these swfs that we currently include:
networkInfoWrapper.swf
servicemonitor.swf
applicationupdater_ui.swf
Many thanks
StephenThe answer is no. Apps developed for AIR using HTML and JavaScript are not supported on iOS or other mobile platforms. The mobile platforms do include a StageWebView component that can be used to load and display HTML and JavaScript. However, it is entirely different than the HTMLLoader control used on the desktop platforms (for HTML-based AIR apps). You cannot, for example, call any AIR/Flash APIs from JavaScript running in a StageWebView. In general, very little communication is possible between your ActionScript application code and the JavaScript code running in the StageWebView object.
-
Javascript maildoc issue with Adobe Reader 9.5
Good morning all,
I am trying to find a possible answer to an issue I have been given regarding the maildoc javascript we are using in one of our forms.
We are on Windows XP, Adobe Reader 9.5 and Outlook 2010.
We generate purchase orders within SAP and forward to out vendors, they supply confirmation information and digitally sign the document. The completed document should then be emailed as an attachment.
Using Adobe Reader X this process runs very smoothly but in 9.5 the email is generated but without the PDF form as an attachment.
Has anybody else had this issue or is this known and not available until X? I have read on a number of posts that there are possible issues with Apple and such the like but wondered whether this was also an issue on the MS platform.
Thanks in advance.
AshleyCould I then ask another question regarding this?
Was it possible to generate the email including the PDF from Adobe Reader in version 9.5 or was this facility only available in Adobe Acrobat until the introduction of Adobe Reader X?
Hope this makes sense as I really need to get an answer back to my boss.
Thanks for any information in advance.
Ashley -
Javascript menu issues in Internet Explorer 7
Ever since Internet Explorer 7 came out I have suddenly been
having issues with javascript menus on a couple sites. The menus
work fine in Safari, Firefox (Mac & PC), as well as past
versions of Internet Explorer. The issue is with any item in the
menu that contains a hyphen - somehow the hyphen is being
misinterpreted by IE7. Either all text after the hyphen is not
visible (happened on one site), or it is interpreted as a line
break and all text after the hyphen gets knocked down to a second
line.
Has anyone else had this problem, or know of a workaround for
it?
Thanks!
janiceSolution found and tested. It works! You'll need to make a
minor change to the MM_Menu.js file. Click on this link to find out
more, on my file it was line 136 that needed to be changed:
http://www.radiantcore.com/blog/archives/16/02/2007/ie7mmmenu -
Solaris 10 Netscape, Java , (Javascript) JSObject Issue.
Hi all,
I am migrating the source code from solaris 8 wtih CC compiler 4.2 to solaris 10 cc compiler 5.7 on x86 Machine. Most of Problems i got solution from C++ forum so i almost through. But while building one directory that contains some java Applets i got issues:-
1. Since its using
import netscape.javascript.JSObject; so it was not getting this JSObject on the latest Solaris 10 Machine. what i did i copied the /outils/netscape/solaris/java_301on solaris 10 Machine from solaris 7 Machine. then i build it again. every thing got build successfully and generated Input.class file but again it gave me following message
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
then i tried with -Xlint option and it again bounce me some errors.
So question here is that on Solaris 10 is there any thing else that i can use for Java Script i.e JSObject if there is no netscape i.e whats the default browser mozillla or netscape. and why java_301 is used and what will happend if i try something else other than java_301. as it was using
-classpath = /outils/netscape/solaris/java_301
while doing javac compiling. and other thing i see is
-classpath /usr/java/lib/classes.zip
but when i see version of java on solaris 10 there is no classes.zip. whats the use of this.??
and when i used -Xlint it bounce error with classes.zip not found.This forum is about using Sun C++. Your question is about Java. You are more likely to get a helpful answer in java forum.
Try the java forum:
http://forum.sun.com/forum.jspa?forumID=8
Maybe you are looking for
-
Double click in ALV tree display....
Hi all, I am able to display output in tree format. But I want to add the double click functionality to some of the fields in output. Means if I double click on some value in output tree, it should call some transaction. Please help me with this issu
-
When I set (on two different computers) the Location Bar option: When using the location bar suggest: to "Nothing" it resets to "History and bookmarks" as soon as I close and reopen Firefox. I am using the latest vesion on Win8 on both computers. One
-
Design View not displaying properly
I am pretty new to Dreamweaver. I can't get my Design view to display properly, even when tried on two different computers. The top div displays properly, then on the nav bar, only the background shows with the table items just listed in a row. Th
-
i downloaded the drivers from the main site but in that zip file all .vis are there. no setup is given. plz help me to fing this driver. here, i am submtting the zip file. Solved! Go to Solution. Attachments: LabView_Dual_Gauge.zip 593 KB
-
RAISING EXCEPTION AND SHOWING TO USERS IN FORM BASED ON STORED PROCEDURE
I have a form based on stored procedure. I want to handle exceptions in the stored procedure and show it to users. Here is what i want to do. I have a sku# field in the form and i want to validate it(against the database table) in the procedure befor