Onsoundcomplete; onload
Hi,
Maybe I am just having a mental block and can't see the wood
for the trees. The issue is that I am creating a sound object
inside a function, and start a sound playing. Then as long as I
address the sound object from inside other functions it works fine,
but not if I address it outside of one.
Here is the code:
quote:
var
currentSound=this.createEmptyMovieClip("mySoundShell",100000);
var mySound;
var moveScrubberInt:Number; // for a interval I am setting
later
function playAudio():Void {
mySound = new Sound(currentSound);
mySound.loadSound(contentArr[currentUnit][1][2], true);
mySound.start()
// get scrubber moving
moveScrubberInt = setInterval(moveScrubber, 100);
mySound.onLoad = function(success:Boolean) { // the code in
here does not get called at all
trace("on load"); /
var totalSeconds:Number = this.duration/1000;
var minutes:Number = Math.floor(totalSeconds/60);
var seconds = Math.floor(totalSeconds)%60;
if (seconds<10) {
seconds = "0"+seconds;
duration_txt.text = minutes+":"+seconds
mySound.onSoundComplete = function() { // the code in here
does not get called at all
clearInterval(moveScrubberInt);
mySound.loadSound();
timelineScrubber_mc.scrub_mc._x = 0;
but this code works fine:
quote:
//Pauses audio
var pos;
function pauseIt():Void
pos = mySound.position;
trace("^^^^^^^^^^^^^^^pauseIt^^^^^^^ pos: " + pos);
mySound.stop();
clearInterval(moveScrubberInt);
Where is my block? Or what is going on here?
I would be grateful for any hints?
Thanks,
Nik
Hi,
Thanks! Initialising the sound object outside the function
makes the onlaod adn onsoundcomplete work, but spoils the .position
resetting for my timeline scrubber display (this is ment to show
the posiiton of the playhead in the audio file so the user knows
how much of the soundfile has been played already.
It seems I can have either one or the other!
Is there a solution!
Nik
Similar Messages
-
Problem with javascript onload in apex page
I want to run some javascript in APEX when the user loads the page, but I am having trouble getting the onload function to work. I’m new to javascript so it’s probably a simple mistake on my part .
All I want to do is to change the background colour of a field (P5_GRPT) depending on the value of another field (P5_MIN_DAYS). I just want to get something basic that works then I can build on it and make it more elegant/generic, but at the moment the script below appears to have no effect whatsoever. Any help would be much appreciated. I have set the cursor focus attribute to “do not focus cursor” (Apex version 3.01.00.12)
Page header html:
<script type="text/javascript">
Function trafficlight()
c = document.getElementById("P5_MIN_DAYS").value;
switch(c)
case 1:
$x("P5_GRPT").style.backgroundColor = "green";break;
case 2:
$x("P5_GRPT").style.backgroundColor = "yellow";break;
default:
$x("P5_GRPT").style.backgroundColor = "red";break;
</script>Page html body:
onload="trafficlight();"hi
I'm new in apex 3.2 javasrcript and speak spanish
i have function in html header
<script language="JavaScript" type="text/javascript">
function colorSal(pCol){
var elms=document.getElementsByname(pCol);
for (i=0; i< elms.length; i++){
if (elms.value < 1500){
elms[i].style.backgroundColor ='yellow';
</script>
and on body header:
onload="colorSal ('f07');"
This should change color column seven of tabular form but it does not happen .
the query in tabular form is
select
"EMPNO",
"EMPNO" EMPNO_DISPLAY,
"ENAME",
"JOB",
"MGR",
"HIREDATE",
"SAL",
"COMM",
"DEPTNO",
"MODIFIED_BY",
"TICKED"
from "#OWNER#"."EMP"
thanks for your help -
Problem with onload in jsp page
Hi all,
I had two jsp pages, a search and a results page. I need to enter some search criteria in the first page and based on that criteria i will be getting the results in the results jsp. Now, when i click the back button in the results page, i need to go to the search page and the values which i entered in the search page needs to be present there. But the problem is i had a javascript function which runs on loading of the search page. This function will set all the values in this search page to empty whenever we go to the search page. I am calling this javascript function as follows in my search jsp page.
<body onload="setdefaultvalues('<%=name%>');">
I am having the code for the back button in the results page as follows.
<INPUT TYPE="button" VALUE='Back' onClick="javascript:history.go(-1);resetvalue(name);" class="button">
The problem i am facing is whenever i go to the search page by clicking on the back button, the values in the search page are getting empty because of the onload method. There is no way that i can remove this onload method as i require it for setting the values in the search page evrytime i get to that from other modules as it is the main page for my module. So, is there anyway that i can stop this function from executing when i come from the results page or is there any other way that i can store the values in the search page when going from the results page.i think you really should have the result page include your search page contents rather than having the user need to click back as you'll end up with all sorts of nightmares in caching & session object management to be honest. if the search page is complex use javascript to hide contents and let the users expand them when they want to re-search.
however, if you feel you must i would suggest the following:
in your result page:
session.setAttribute("userQuery","true"); (you probably actually want to put a container object with the query information in here)
in your search page you could have something like:
<body <% session.getAttribute("userQuery")==null { %>onload="setdefaultvalues('<%=name%>');"<% } %>>
-or-
<body onload="setdefaultvalues('<%=name%>',<%=session.getAttribute("userQuery")==null?"true":"false"%>);">
function setdefaultvalues(name,run) { if ( !run ) return;....}
you'll have to decide when to remove the object though cause once its set its there until the session expires or you remove it.
hope that helps, good luck! -
Fms onLoad fails in one environment, but not another
Totally stumped!
I have an application that was running at influxis, no problem. The server side script performs an XML sendAndLoad, and then calls the client based upon the xml response.
But then i installed my main.asc file into a different dev environment and the xml.sendAndLoad request totally fails. Using onHTTPStatus, I discovered that the error type is <100, with an error code of 0. According to Adobe, a 0 indicates that things were fine.
I then implemented the onData method as shown in the adobe docs, and 'src' is coming back as undefined.
The network engineer has confirmed that there are no network/firewall issues that would impact FMS talking to our application server, so FMS and the app server are free and clear to communicate with each other.
Is there some sort of other setting that needs to happen to allow FMS to send and receive data? Is there something else I'm missing here?
m
.onData = function(src) {
trace(">> " + this.httpStatusType + ": " + this.httpStatus);
if (src == undefined) {
trace("src == undefined. call onLoad(false) now. src = "+src);
this.onLoad(false);
} else {
trace("src != undefined. call onLoad(true) now. src = "+src);
this.parseXML(src);
this.loaded = true;
this.onLoad(true);I guess it may be due parsing error of xml file which you are using. Can you try with sample.xml given below :
//sample.xml
<Root>
<UserList>
</UserList>
</Root>
And then let me know all details as you told for the previous one.
Regards,
Amit -
How to execute a javascript function in the body onload?
Hi everyone!
As you know in the HTML body attribute. You must specify the value of onload
What is the correct sintaxis for execute a function since in the onload body?
I only want to do some like this, but only I do it in APEX:
<body onload ="javascript:namefunction();" >
I do not know how to use #ONLOAD# when you using want to set some value.
Could u help me please ?
Any help would be very appreciated.
Thank u in advance
Best RegardsHi Chris
Thank you for your help
I tried with the next code but it doesn´t work.
Do you know for what?
Best Regards
I paste the next code in the HTML Header :
<head>
<script language="JavaScript" type="text/javascript">
function addLoadEvent(func){
var oldonload = window.onload;
if (typeof window.onload != 'function'){
window.onload = func;
else {
window.onload = function() {
oldonload();
func();
function ejecuta()
doSubmit('ACEPTAR_R')
addLoadEvent( ejecuta );
</script>
</head> -
While executing onLoad in Date_before Save.htm, a JavaScript error occurred
While executing onLoad in Date_before Save.htm, a JavaScript error occurred, I have looked af the Forum and it tells me to delete Program Files\Macromedia\Dreamweaver CS3\Configuration\Commands and I cannot find these files despite searching.
I had a text conversation with support at Adobe and they no longe support Dreamweaver CS3! Has anyone else had a similar problem and if so how was it fixed.
RegardsTroubleshooting JavaScript errors in Dreamweaver
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_19105#dat
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"jockamo" <[email protected]> wrote in
message
news:etpo3o$54c$[email protected]..
>I have set up some pages to have an automatically
updating "Last Modified
>On"
> date. However, I have been getting 2 error dialog boxes
every time I save
> a
> file, both with the same message: "While executing
onLoad in
> Date_beforeSave.htm, a javascript error occurred." In
looking at some
> other
> threads on this forum, I have tried deleting the
Application Data files
> "Configuration\SiteCache\SEL Web Site.dws" and
> "Configuration\WinFileCache-####.dat". I have also tried
several
> different
> date formats, but that didn't seem to change anything.
>
> I have not been able to find any threads specific to
this exact error,
> though.
>
> Any help would be highly appreciated! The site is at
>
http://picea.sel.uaf.edu/index.html,
if that helps.
>
> Thanks for your help,
> Jock
> -
I have set up some pages to have an automatically updating
"Last Modified On" date. However, I have been getting 2 error
dialog boxes every time I save a file, both with the same message:
"While executing onLoad in Date_beforeSave.htm, a javascript error
occurred." In looking at some other threads on this forum, I have
tried deleting the Application Data files
"Configuration\SiteCache\SEL Web Site.dws" and
"Configuration\WinFileCache-####.dat". I have also tried several
different date formats, but that didn't seem to change anything.
I have not been able to find any threads specific to this
exact error, though.
Any help would be highly appreciated! The site is at
http://picea.sel.uaf.edu/index.html,
if that helps.
Thanks for your help,
JockTroubleshooting JavaScript errors in Dreamweaver
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_19105#dat
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"jockamo" <[email protected]> wrote in
message
news:etpo3o$54c$[email protected]..
>I have set up some pages to have an automatically
updating "Last Modified
>On"
> date. However, I have been getting 2 error dialog boxes
every time I save
> a
> file, both with the same message: "While executing
onLoad in
> Date_beforeSave.htm, a javascript error occurred." In
looking at some
> other
> threads on this forum, I have tried deleting the
Application Data files
> "Configuration\SiteCache\SEL Web Site.dws" and
> "Configuration\WinFileCache-####.dat". I have also tried
several
> different
> date formats, but that didn't seem to change anything.
>
> I have not been able to find any threads specific to
this exact error,
> though.
>
> Any help would be highly appreciated! The site is at
>
http://picea.sel.uaf.edu/index.html,
if that helps.
>
> Thanks for your help,
> Jock
> -
What is the conversion of onload event to AS3 ?
I have following code on AS2 . Now I need to convert into AS3. Please give your idea to change into AS3
myxml2.onLoad = function() {
// functionality goes here
myxml.load(my.xml);var xml:XML;
var url:String = "sample.xml";
var req:URLRequest = new URLRequest(url);
var loader:URLLoader = new URLLoader(req);
loader.addEventListener(Event.COMPLETE, loaderCompleteHandler);
function loaderCompleteHandler(event:Event):void {
xml = new XML(event.currentTarget.data);
trace(xml.toXMLString());
Or one could always RTFM: Reading external XML documents
http://livedocs.adobe.com/flash/9.0/main/00000132.html -
Onload event after all images are loaded in an updateContent area
Hi Spry Folks!
I load a template into a page with a lot of img tags inside
it. Everything works fine.
Spry.Utils.updateContent (...HTML wit lots of img tags...)
But the loading takes a while so I would like to hide it
until all the images are loaded. Now I need an event which fires
after the loading bar in the browser is gone.
The onPostLoad observer fires much to early, cause the code
is long loaded bevore all the images
(...addObserver({onPostLoad:...)
Same with the window.onload event (...window.onload =
showContent();...) fires much to early.
The only thing which is working is placeing the function in
the onload event of the body tag.
Like:
<body onload="showContent();">
But there I can't use it. And there is now body.onload
handler as far as I know there is only the windows.onload handler
and I thought always this is the same event than onload in the body
tag.
Has anyone an idea? Is there a spry event I haven't found for
exact this problem?
Thanks for your help!
regrads
marcusHello,
U might want to look in to the SpryImageLoader.js that comes
with the 1.6.1 download. It loads your images, and allows u put
callbacks on them, and set priority of loading them.
http://www.dbooth.net/photos/
uses it to (expect don forgot to upload the
SpryImageLoader.js thats why its not really working :P )
But that will give the basic idea of how to use it.
Spry.Utils.ImageLoader.(url, callback(needs to be a function
or null), priority) -
Problem with onload attribute in body tag
hi all,
i have been trying to test alert message boxes in servlets.when i am trying to run the servlet the alert window box doen;t appear (but it appears when i put "hello" inside the alertbrackets.and if i change it to some other text , it never appears.sounds silly , but pleas help me.
please help me out. below is the code:
public class TestApplet extends HttpServlet
PrintWriter out = null;
public void doPost (HttpServletRequest req, HttpServletResponse res) throws ServletException , IOException
String strAlert = "alert('The userid is already existing.Please select another one')";
out=res.getWriter();
res.setContentType("text/html");
out.println("<html>");
out.println("<head>");
out.println("<title>Welcome To Online Stock Market</title>");
out.println("</head>");
out.println("<body onload ="+strAlert+">");
out.println("</body>");
out.println("</html>");
out.close();
public void doGet(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException
doPost(req, res);
}Instead of:
out.println("<body onload ="+strAlert+">");
Try this:
out.println("<body onload =\""+strAlert+\"">");
Add two \" around the alert call. -
Af:region, PPR and onload handler
We develop custom JSF components that need some javascript counterpart on the client.
These counterparts needs to be initialized (through some AJAX calls) when the page is ready to be displayed.
In old technologies, this was done through an "onload" javascript handler placed on the page.
In Apache Trinidad PPR, the page is already loaded when the components are rendered, and we need to register those scripts at render time (in encodeEnd) through :
ExtendedRenderKitService service = Service.getRenderKitService(context, ExtendedRenderKitService.class);
service.addScript(context, jsMethod);This method is available in ADF, so we can reuse this.
However, since the default onload mechanism already calls the scripts, and we want the scripts to be called only once, we need to make sure we are in a PPR context by using something like
reqContext.isPartialRequest(context);Now, in an af:region use case, we are not really in a PPR rendering (isPartialRequest returns false). What API should I use to check that the page is already loaded and we are just rendering a new region in that page ?I tried the AdfFacesContext.getCurrentInstance().isInitialRender() through layers of reflection, to keep independent at compile time from ADF.
However, even when this "initialRender" flag is true, the page rendering (client side) still goes through ADF AJAX calls and does not happen directly in the browser window.
I need in fact to detect, server side, whether the HTML I'm rendering will be executed directly in the browser (in that case, the "onload" happens) or through some indirection on the client where DOM elements such as "document" or "window" may not exist. In the latter case, I will register a script through the ExtendedRenderKitService class.
Any idea on the way I can do this in case of an af:region ? -
JSP + JScript + onLoad and return
i have a return issue with a jsp as follows:
=================================
one jsp:A calls another jsp: B and is loaded into Frame1.
a click event in the jsp B in Frame1 calls another jsp C (with the target specified as Frame2) which does the following:
jsp C
<html>
<head>
<script>
function redirect(){
parent.Frame1.location.href="http://myServer/final.jsp";
return;
</script>
</head>
<body onLoad="redirect()" >
<% String Param1 = null; %>
<% String Param2 = null; %>
<% Param1 = request.getParameter("p1"); %>
<% Param2 = request.getParameter("p2"); %>
<% if(bookParam1 != null && bookParam2 != null){
response.sendRedirect("/servlet/doSomething?p1=" + Param1 + "&p2=" + Param2);
%>
</body>
</html>
=======================================
this jsp should onLoad load a jsp into Frame1 using the jscript function- then continue to action the java response.sendRedirect command which has a target of Frame2 as specified by jsp C.
without the java code the jsp works
BUT
with the java code the onLoad method seems to be ignored and the sendRedirect loads into Frame2.
any ideas why or how i can get both to work? i tried addding the "return" keyword but to no avail.
(using apache / tomcat)the reason may be that the java code is executed before javascript is called because JavaScript is executed on the Client while Java is executed on the server.
-
Making OnLoad work in individual cells in multiple rows
Dear Raj et al...
thanks for your help with getting the java applet (JMOL) working in individual cells/rows in report tables.
I now need some help with getting OnLoad to work in each row.
I am able to make it work in an HTML region (not in a report table) where I use <body #ONLOAD#> in the HTML region and OnLoad="document.jmol.loadinline(getElementById('P16_text').value)"; in the 'On Load' region in page template.
However if I use OnLoad="document.jmol#AUTOKEY#.loadinline(getElementById('f01_#ROWNUM#').value)";
and put body tags in the Report Attributes\Column Formatting\html expression region where I have embeded the applet tags it doesn't work.
I don't think the #AUTOKEY# and #ROWNUM# are the problem as I also tried explicitly naming the objects:
OnLoad="document.jmol1.loadinline(getElementById('f01_1').value)";
and it still didn't work.
Again any suggestions will be greatly appreciated!
-DaveActually I take that back...
"I don't think the #AUTOKEY# and #ROWNUM# are the problem as I also tried explicitly naming the objects:
OnLoad="document.jmol1.loadinline(getElementById('f01_1').value)"; and it still didn't work."
The reason this didn't work is that I had two javascript calls in the on load section and I obviously didn't format them properly (the first worked not the second).
In any case, this worked once it was made the only javascript call in the on load section.
When I tried to use #AUTOKEY# or #ROWNUM# these were then flagged with an "Invalid Character" error.
Do you have any suggestions as how to have variable names put in the "OnLoad" statement and will it work for the n rows that are queried?
Thanks a lot!
-Dave -
Onload and Tabbing focus problem
I was asked by some of my users to set focus to the username
field on the login page when it loads. I began by adding to the
body tag and cfform tags OnLoad function. This allowed the page to
load and set up the user to just start typing without clicking in
the field. The problem is with trying to tab to the next field. The
only way I can even start tabbing to other fields is to click in
one and then depress the tab key. However, this only tabs over to
the other two fields while leaving out one of the fields.
I would like the page to load so that the user can start
typing and then by pressing tab he can move on to the next field. I
don't know why this code doesn't work. It is kind of frustrating.
Does anybody know of a fix to this problem?
Thank you for your time!Use a tabindex attribute in your form fields:
http://www.htmlgoodies.com/tutorials/forms/article.php/3479201
Tom Muck
co-author Dreamweaver MX 2004: The Complete Reference
http://www.tom-muck.com/
Cartweaver Development Team
http://www.cartweaver.com
Extending Knowledge Daily
http://www.communitymx.com/
"jedale" <[email protected]> wrote in
message
news:[email protected]...
I was asked by some of my users to set focus to the username
field on the
login
page when it loads. I began by adding to the body tag and
cfform tags
OnLoad
function. This allowed the page to load and set up the user
to just start
typing without clicking in the field. The problem is with
trying to tab to
the
next field. The only way I can even start tabbing to other
fields is to
click
in one and then depress the tab key. However, this only tabs
over to the
other
two fields while leaving out one of the fields.
I would like the page to load so that the user can start
typing and then by
pressing tab he can move on to the next field. I don't know
why this code
doesn't work. It is kind of frustrating. Does anybody know of
a fix to this
problem?
Thank you for your time!
<body onLoad="self.focus();document.login.focus()"
bgcolor="#F2F9FF">
<center>
<cfform format="flash" name="login" action="login.cfm"
method="post"
width="100%" height="100%" preservedata="true"
preloader="yes"
timeout="3600"
wmode="transparent" style="font-size:12px; font-weight:bold;
background-color:##F2F9FF; themeColor:##003366"
onload="name.setFocus();">
<cfformitem type="script">
function Tabit(){
if(Key.getCode() == Key.TAB){
password.setFocus()
</cfformitem>
<cfformgroup type="vbox"
style="horizontalAlign:'center';" id="mainbox">
<cfformgroup type="panel" id="loginPanel"
style="headerHeight:0;panelBorderStyle:'roundCorners';
shadowDistance:1;
background-color:##80A8D5; marginTop:0;" width="320"
height="80">
<cfformitem type="spacer" height="2" />
<cfinput width="200" maxlength="30" type="text"
name="name" label="Name"
style="font:Arial, Helvetica, sans-serif; font-size:12px;
font-weight:normal"
onKeyDown="Tabit();">
<cfinput width="200" maxlength="30" type="password"
name="password"
label="Password" style="font:Arial, Helvetica, sans-serif;
font-size:12px;font-weight:normal" >
</cfformgroup>
<cfformgroup type="vbox">
<cfformgroup type="horizontal"
style="horizontalAlign:'center';">
<cfinput type="button" name="logInButton" value="Log In"
onClick="alert('Submitted form');">
</cfformgroup>
</cfformgroup>
</cfformgroup>
</cfform>
</center>
</body> -
I have a main banner that loads 3 other banners. When the
main one loads the others, part of the main banner is behind the
loaded ones. I want the main banner to be in the front and the
onload banners to be behind. How do I fix this? Here's my code.
_root.createEmptyMovieClip("container", 1);
loadMovie("banner1.swf", "container");
container._x = 0;
container._y = 0 ;
_root.but.onPress = function () {
_root.createEmptyMovieClip("container", 1);
loadMovie("banner1.swf", "container");
container._x = 0;
container._y = 0;
but.gotoAndStop(2);
but3.gotoAndStop(1);
but2.gotoAndStop(1)
but2.onPress = function () {
_root.createEmptyMovieClip("container", 1);
loadMovie("banner2.swf", "container");
but2.gotoAndStop(2);
but.gotoAndStop(1);
but3.gotoAndStop(1)
container._x = 0;
container._y = 0;
but3.onPress = function () {
_root.createEmptyMovieClip("container", 1);
loadMovie("banner3.swf", "container");
container._x = 0;
container._y = 0;
but3.gotoAndStop(2);
but.gotoAndStop(1);
but2.gotoAndStop(1)use swapDepths() to move your main banner to a depth above
your depth 1 loaded banners.
Maybe you are looking for
-
DreamWeaver CS6 starts very slow on MacBook (Lion)
I am relatively new to the Mac, so I my need a little hand holding on this. I signed up for two licenses of the Creative Cloud, one for home and one for work. The one for work is on a late 2011 version of the MacBook Pro with Lion (10.7.5) running, 2
-
DBTools and SQLNET Client on Oracle 9i Linux for OS/390
We have been trying to evaluate Oracle 9i using the developers release and my database guy has the following questions. "I've been unable to access [Oracle]using any of my database tools on my workstation. In the past, there has been no incompatibili
-
Difference between Actual Cost and Allocable costs in splitting KSS2
I have Cost splitting structure results with me(KSS2) What is the difference between Actual Costs, Control Costs, Allocable Actual, Actual cost balance and which amount will system consider for calculating the rate with dividing the activity rates.
-
I have many large (8 to 200 Meg) file size pdf's made up of images I need to make website links to. I can use them as is, but ended up buying Acrobat X Standard to help me make them smaller and more quickly accessible. I used Acrobat X to extract (
-
HELP! Major Project due tomorrow...need quick fix advice
I have just finished creating a movie and my deadline to submit is tomorrow. Everything looks good, but when I added in a few clips, following this... it speeds up the rest of the video (i.e. the audio is normal, but the video looks like it is moving