Jump to content

ecluley

Members
  • Content count

    25
  • Joined

  • Last visited

Community Reputation

0 Neutral

About ecluley

  • Rank
    Newbie
  1. Get Dimensions Of Flash Movie

    hmmm, have been playing about with this all day and it looks like the offsetWidth is giving me an incorrect value, i.e. it is returning the width of the window and not of my flash movie. is there any way of just getting the width of the flash movie? basically what I am actually trying to do is make a page with a flash movie and then an iframe layed over the top of it. The flash movie will resize with the window (this works using the width=100% and height=100%) but what i need is to resize the iframe in the div layer and possition it so that it remains in proportion to the flash movie.does that make sense?thanks for the help so far and hope someone can advise me on a way to do this!thanksEwen
  2. Get Dimensions Of Flash Movie

    wow, thanks so much for the quick reply and solution- it worked well!for some reason the width works perfectly but the height just always returns 16. not sure why but to be honest it doesn't matter as i can use math to work out the height anyways! cheersEwen
  3. Get Dimensions Of Flash Movie

    hi, i am trying to use javascript to get the dimensions of a flash movie and i found a tutorial and script which does this. the only problem is that my flash movie resizes with the window but the javascript keeps returning the original dimensions- i assume it's simply getting the actual dimensions of the swf file but i need it to get the dimensions of the flash movie on screen. Is there a way of doing that? hope that makes sense and thanks in advance!here's my code: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>index</title><script language="javascript">function getFlashObj(movie){ if (window.document[movie]) { return window.document[movie]; } if (navigator.appName.indexOf("Microsoft Internet")==-1) { if (document.embeds && document.embeds[movie]) { return document.embeds[movie]; } } else { return document.getElementById(movie); }}function getDimensions(movie) { var movieObj = getFlashObj(movie); var width = movieObj.TGetProperty("/", 8); var height= movieObj.TGetProperty("/", 9); alert("The current dimensions for the Flash Object ("+movie+") are "+width+" in width and "+height+" in height.");}</script></head><body bgcolor="#ffffff"><object id="detectme" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"><param name="movie" value="index.swf"><param name="quality" value="high"><param name="allowscriptaccess" value="samedomain"><embed src="index.swf" name="detectme" swliveconnect="true" width = "100%" height = "100%" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object><input type="button" onclick="getDimensions('detectme');"></body></html>
  4. Ajax File Upload

    ok, i see, so i can't send a file to an asp script using ajax?i think i found a tutorial for doing it with so ill take a look at that.thanks for your help, u always seam to be around to assist me with my silly questions.Cheers,Ewen
  5. Ajax File Upload

    Hey, having a bit of trouble with a file upload that im building. I know that my upload script (ASP) works as I have used it. My problem is getting it to run correcly from ajax.I have a form with a button and a file input and a text box (for some sort of response)my ajax function is called when the button is clicked and the button passes the file object to the ajax function.I have put in several "alert()"s to see where my code is at and whether it is working and all come up as if the code runs completely.The problem is, i get back "<h1>Length Required</h1>" rather than the output from the asp file.so my code is thus, toUpload being the file passed from the form. function ajaxFunction(toUpload){var xmlhttp;if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else if (window.ActiveXObject) { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }else { alert("Your browser does not support XMLHTTP!"); }xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4) { document.myForm.time.value=xmlhttp.responseText; //this should print the response from the uploadimage.asp into the time box }}alert("sending")xmlhttp.open("POST","uploadimage.asp",true);xmlhttp.send(null);} and my form looks like this <form name="myForm" ENCTYPE="multipart/form-data">Name: <input type="file" name="toUpload" />Time: <input type="text" name="time" /><input type="button" onclick="ajaxFunction(toUpload);"/></form> and my asp is, just to test, <%response.write("works")%> the thing i get back is "<h1>Length Required</h1>" and i cannot work out what im doing wrong.also, have tried adding xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.setRequestHeader("Content-length", parameters.length);xmlhttp.setRequestHeader("Connection", "close"); just before the xmlhttp.send(null); in the ajax function.I am pulling my hair out over this but really don't understand it. Hope someone can shed some light on this.Thanks
  6. Wysiwyg Editor

    ah dear, i am a bell end!I found the problem, i simply wasn't referencing the iframe correctly- by referencing the actual frame rather than the document within i think?!I used document.getElementById("rte").execCommand(insertimage, false, imagePath)rather thandocument.getElementById('rte').contentWindow.document.execCommand(insertimage, false, imagePath)Thanks for the suggestions, made me look over my code and a few tutorials.I am a total javascript noob :)ta
  7. Wysiwyg Editor

    Thanks for your quick response.I did originally think that that maybe the problem but had at first tried a different name for the function- RTEinsertImage. I tried changing everything back to this but the same problem.When i click the button to bring up the DIV for the image selector the iframe becomes unfocused. I then click back in the iframe, returning the cursor to the correct place but when I click to actually insert the image the iframe unfocused and nothing else happens.The focus functions I have are different but this was simply because I was testing different ways to see if it made a difference. What is the correct code for focusing my iframe? every tutorial and website says something different and I just can't really get any focus commands to work at all.Hope you can help, I am getting very dishartened with this roject- possibly bit off a little more than I can chew!Thanks againEwen
  8. Wysiwyg Editor

    Hi,I have a small problem and was wondering if anyone could give me some advice about it.I am building a WYSIWYG text editor using JavaScript and a bit of ASP. I have built the basic functions but am having problems adding a way of inserting an image. I have read many examples which bring up a prompt box and the user types in the image location and it inserts it but I was wanting something a little more sophisticated with thumbnails of all available images coming up in a div layer. When the layer comes up it displays fine but upon clicking to insert an image absolutly nothing happens. I get the feeling that the iframe i'm inserting into is no longer focused but am unable to work out how to do this.I think the problem maybe coming in whith my insert image function: function image(imagePath){ document.getElementById("rte").contentWindow.document.focus(); document.getElementById('rte').execCommand('InsertImage', false, imagePath); } or my div layer: Insert Image<input onmouseover="this.style.cursor='pointer';" onmouseout="this.style.cursor='default';" type="button" onclick="displayImagePicker('true');" ID="pic" value=""><input type = "text" id="imgpath"><div id="imagePicker" class="imagePicker">Choose an image to insert...<br><table><tr><% dim imagePath, formatedPathfor i = 1 to 10 imagePath = "http://www.umbrellamembers.co.uk/users/" & usr & "/" imagePath = imagePath & "img" & i & ".jpg" formatedPath = "<td><button onclick=" & chr(34) & "image('" & imagePath & "');" & chr(34) & " width = 50 src = '" & imagePath & "'></td>" Response.write(formatedPath)next%></tr></table><input type="button" onclick="displayImagePicker('false');" ID="closeImagePicker" value="Cancel"><br></div> My full code is as follows and includes a few other things which mostly work fine. <html><head><script src="201a.js" type="text/javascript"></script><script src="imagePicker.js" type="text/javascript"></script><style>#btnB{ font-weight: bolder;}#btnI{ font-style: italic;}#btnU{ text-decoration: underline;}.imagePicker{ visibility:hidden; display:none; position:absolute; background:#FFF; border:solid 1px #CCC; padding:4px; z-index:999; filter: progid:DXImageTransform.Microsoft.Shadow(color=#D0D0D0,direction=135);}</style><script type="text/javascript"> var obj;function Init(){ obj = document.getElementById("rte"); obj.contentWindow.document.designMode = "On"; //obj.contentWindow.document.contentEditable = "True";}function RTEDo(name){ obj.contentWindow.document.execCommand(name, false, null); document.getElementById("rte").focus();}function RTEtext(name){ obj.contentWindow.document.execCommand("fontname" , false, name); document.getElementById("rte").focus();}function image(imagePath){ document.getElementById("rte").contentWindow.document.focus(); document.getElementById('rte').execCommand('InsertImage', false, imagePath); }function RTEconvert() { var iframe_window = window.frames["rte"]; var iframe_body_html = iframe_window.document.getElementsByTagName("body")[0].innerHTML; document.getElementById("text").value = iframe_body_html; } function displayImagePicker(val){ var display = val if(display=="true"){ var vis = "visible" var disp = "block" }else{ var vis = "hidden" var disp = "none" } document.getElementById('imagePicker').style.visibility=vis document.getElementById('imagePicker').style.display=disp}</script></head><body onLoad="Init();"><p><!--#include file="header.asp"--></p><table cellspacing = 0><tr bgcolor="#990000" valign="center"><td valign="centre" halign="center"><input type="image" src="bold.gif" name="btnBold" value="B" id="btnB" onClick="RTEDo('bold');" /><input type="image" src="italic.gif" name="btnItalic" id="btnI" value="I" onClick="RTEDo('italic');" /><input type="image" src="underline.gif" name="btnUnderline" id="btnU" value="U" onClick="RTEDo('underline');" /><select><option onclick="RTEtext('times');">Times New Roman</option><option onclick="RTEtext('Tahoma');">Tahoma</option><option onclick="RTEtext('Arial');">Arial</option><option onclick="RTEtext('Verdana');">Verdana</option></select>Colour<input type="hidden" ID="input_field_1" value=""><input onmouseover="this.style.cursor='pointer';" onmouseout="this.style.cursor='default';" type="text" onclick="showColorGrid2('input_field_1','sample_1');" ID="sample_1" size="1" value=""><div id="colorpicker201" class="colorpicker201"></div>Insert Image<input onmouseover="this.style.cursor='pointer';" onmouseout="this.style.cursor='default';" type="button" onclick="displayImagePicker('true');" ID="pic" value=""><input type = "text" id="imgpath"><div id="imagePicker" class="imagePicker">Choose an image to insert...<br><table><tr><% dim imagePath, formatedPathfor i = 1 to 10 imagePath = "http://www.umbrellamembers.co.uk/users/" & usr & "/" imagePath = imagePath & "img" & i & ".jpg" formatedPath = "<td><button onclick=" & chr(34) & "image('" & imagePath & "');" & chr(34) & " width = 50 src = '" & imagePath & "'></td>" Response.write(formatedPath)next%></tr></table><input type="button" onclick="displayImagePicker('false');" ID="closeImagePicker" value="Cancel"><br></div><input type="image" src="left.gif" name="btnLeft" value="L.." id="btnLeft" onClick="RTEDo('justifyleft');" /><input type="image" src="center.gif" name="btnCenter" value=".C." id="btnCenter" onClick="RTEDo('justifycenter');" /><input type="image" src="right.gif" name="btnRigth" value="..R" id="btnRight" onClick="RTEDo('justifyright');" /><input type="image" src="indent.gif" name="btnCenter" value=".C." id="btnIndent" onClick="RTEDo('indent');" /><input type="image" src="outdent.gif" name="btnRigth" value="..R" id="btnOutdent" onClick="RTEDo('outdent');" /><input type="image" src="cut.gif" name="btnCut" value="Cut" id="btnCut" onClick="RTEDo('cut');" /><input type="image" src="copy.gif" name="btnCopy" value="Copy" id="btnCopy" onClick="RTEDo('copy');" /><input type="image" src="paste.gif" name="btnPaste" value="Paste" id="btnPaste" onClick="RTEDo('paste');" /></td></tr><tr bgcolor="#ff9900" valign="center"><td align="center"><form method="POST" action="processHTML.asp" onsubmit = "RTEconvert();"><table bgcolor = "#ffffff"><tr><td width="700px"><iframe width="100%" name="rte" id="rte"></iframe></td></tr></table><input type="hidden" id="text" name="text"><input type ="submit" value = "Submit"></form></td></tr></table><% end if %></body> Wonder if anyone has any advice or links to good tutorials about how to do this?ThanksEwen
  9. problems with include files

    ok, that does work but surely I shouldnt have to. to further complecate things this is all part of a web site and web editor i made for a friend. basically the web editor takes in rich text and encodes it to html. it generates the html code and I cannot find a way- even using replaces of getting this to wrk. i understand your solution works as a work around but unfortunately it does not fix my problem. I need to know why the include is not allowing the £ to be displayed.thanks for your help and your quick response- it has given me some food for thought. still looking for a solution though!Ewen
  10. problems with include files

    when I try to include html files on an asp webpage any £ symbols in them become ? or funny little boxeshere is how the include file displays: appointments last for one hour and cost �100 - you can make an appointment by calling Caroline on 07886234559 or by emailing kathleen@reverse-therapy.com Make the first step to getting your health back! and this is the html code for the include file: Appointments last for one hour and cost £100 - you can make an appointment by calling Caroline on 07886234559 or by emailing kathleen@reverse-therapy.com <br><br>Make the first step to getting your health back!<br> and the html file when viewed on its own is the same as the code basically. it has the £ signsAny ideas?Cheers
  11. Response Buffer Limit Exceeded

    ok, got it. im an idiot. sory!
  12. Response Buffer Limit Exceeded

    I have a very strange problem. I have built an online calendar for myself to keep track of things with and all works fine untill i go to june. Basically the calendar is one asp page that takes in a Query string of the month it is to display which then links into the database and returns the data required. Whenever this query string is equal to 6(for june), no other number, it comes back with this error.Response object error 'ASP 0251 : 80004005'Response Buffer Limit Exceeded/calendar2.asp, line 0Execution of the ASP page caused the Response Buffer to exceed its configured limit. Any ideas why?calendar2.asp <html><head><title>My Umbrella Calendar</title><script language="JavaScript">function getFlashMovieObject(movieName){ if (window.document[movieName]) { return window.document[movieName]; } if (navigator.appName.indexOf("Microsoft Internet")==-1) { if (document.embeds && document.embeds[movieName]) return document.embeds[movieName]; } else // if (navigator.appName.indexOf("Microsoft Internet")!=-1) { return document.getElementById(movieName); }}function ReceiveDataFromFlashMovie(){ var fullURL = parent.document.URL var mon = fullURL.substring(fullURL.indexOf('?')+7, fullURL.length) var Qstring = 'update_multi2.asp?available=yes&month=' + mon for (k=1;k<=31;k=k+1) { var flashMovie=getFlashMovieObject(k); var message=flashMovie.GetVariable("_root.checked"); if (message == "true"){ Qstring = Qstring + "&" + k + "=true" } } window.location = Qstring }function unReceiveDataFromFlashMovie(){ var fullURL = parent.document.URL var mon = fullURL.substring(fullURL.indexOf('?')+7, fullURL.length) var Qstring = 'update_multi2.asp?available=no&month=' + mon for (k=1;k<=31;k=k+1) { var flashMovie=getFlashMovieObject(k); var message=flashMovie.GetVariable("_root.checked"); if (message == "true"){ Qstring = Qstring + "&" + k + "=true" } } window.location = Qstring}</script><% sub buildCallender() dim month month = Request.QueryString("month") Select Case month case 1 buildMonth(31) case 2 buildMonth(29) case 3 buildMonth(31) case 4 buildMonth(30) case 5 buildMonth(31) case 6 buildMonth(30) case 7 buildMonth(31) case 8 buildMonth(31) case 9 buildMonth(30) case 10 buildMonth(31) case 11 buildMonth(30) case 12 buildMonth(31) end select end sub sub buildMonth(x) dim z, available, month, monday, firstMon, blanks, dot, datamonth, notes z = x dot = date() datamonth = int(DatePart("m", Date())) month = int(Request.QueryString("month")) 'Build connection with database set conn = server.CreateObject ("ADODB.Connection") conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath ("users\" & usr & "\2008.mdb") set rs = server.CreateObject ("ADODB.Recordset") rs.Open "SELECT * FROM 2008 where monthNo=" & month, conn, 1 firstMon = rs("firstMonday") rs.Close%><table width = "630"><tr><font color="#990000" face = "Verdana"><td align = "center" width = 90><font color="#990000" face = "Verdana">Monday</td><td align = "center" width = 90><font color="#990000" face = "Verdana">Tuesday</td><td align = "center" width = 90><font color="#990000" face = "Verdana">Wednesday</td><td align = "center" width = 90><font color="#990000" face = "Verdana">Thursday</td><td align = "center" width = 90><font color="#990000" face = "Verdana">Friday</td><td align = "center" width = 90><font color="#990000" face = "Verdana">Saturday</td><td align = "center" width = 90><font color="#990000" face = "Verdana">Sunday</td></tr></table><br> <% dim i,thirtyfivecounter thirtyfivecounter = 0 if firstMon > 1 then blanks = 8 - firstMon for i = 1 to blanks Response.write("<img src = 'blank.gif'>") thirtyfivecounter = thirtyfivecounter + 1 Next End if for i = 1 to z 'Open record with correct date rs.Open "SELECT * FROM " & month & " where date=" & i, conn, 1 available = cStr(rs("available")) monday = rs("monday") notes = rs("notes") rs.close rs.Open "SELECT * FROM 2008 where monthNo=" & month, conn, 1 rs.close if monday = true and i > 1 then Response.write("<br>") End If //if month < datamonth then //available = "no" //End If //if i <= DatePart("d", Date()) and month = datamonth then //available = "no" //End If Response.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='' id='" & i & "' width=90 height=90><param name=movie value='daytile2.swf?location=" & available & "&date=" & i & "&month=" & month & "&notes=" & notes & " '><EMBED swliveconnect='true' src='daytile2.swf?location=" & available & "&date=" & i & "&month=" & month & "&notes=" & notes & " ' quality=high bgcolor=#FFFFFF WIDTH='90' HEIGHT='90' NAME='" & i & "' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED></object >") thirtyfivecounter = thirtyfivecounter + 1 Next do until thirtyfivecounter = 35 Response.write("<img src = 'blank.gif'>") thirtyfivecounter = thirtyfivecounter + 1 loopend sub%></head><body><p><!--#include file="header_cal.asp"--></p><center><p><h2><font color="#990000" face = "Verdana" >2008</h2></p><center><% dim month, n, availmonth = cStr(Request.QueryString("month"))Response.write("<EMBED src='month_bar2.swf?months=" & month & "' quality=high bgcolor=#FFFFFF WIDTH='550' HEIGHT='100' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED>") %><br><br><tabel><%buildCallender()if month = "" then dim cal_string, datamonths datamonths = int(DatePart("m", Date())) cal_string = "calendar2.asp?month=" & datamonths //& cStr(DatePart("m", Date()) Response.Redirect (cal_string)end ifResponse.write("<form name='controller' method='POST'><input type='button' value='Make Selected Available' name='ReceiveData' onClick='ReceiveDataFromFlashMovie()' ><br><input type='button' value='Make Selected Un-Available' name='ReceiveData2' onClick='unReceiveDataFromFlashMovie()' ></form></td></tr></table>")Else Response.write("Access Denied<br><a href='index.asp'>Go Back</a>") End If%> header_cal.asp <html> <title>Umbrella Artist Care - Website Editor</title> <body><%If Session("permission") = "YES" Then Dim usr usr = Session("username") %> <center> <EMBED src='logo.swf' quality=high bgcolor=#FFFFFF WIDTH='550' HEIGHT='130' NAME='logo' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED><br><br><% 'Build connection with database set conn = server.CreateObject ("ADODB.Connection") conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath ("users.mdb") set rs = server.CreateObject ("ADODB.Recordset") 'Open record with entered username rs.Open "SELECT * FROM userlist where username='"& usr &"'", conn, 1 'If there is no record with the entered username, close connection 'and print out access denied, also set session(permission) to "NO" If rs.recordcount = 0 then rs.close conn.close set rs=nothing set conn=nothing response.write("Access Denied") Session("permission")="NO" Session("username")=Username Response.Redirect("index.asp") end if%>
  13. Paypal payment then download

    Hey,I am needing to allow people to buy a product from my website using paypal. The product is a download so i want the download to start once the payment is complete. is there anyway of doing this using asp?Cheers
  14. Make folder

    amazing mate! worked a treat. cheers for the quick response too!
  15. Make folder

    I am trying to have a script make a folder then copy some files into itmy code is as follows:dim fs,fset fs=Server.CreateObject("Scripting.FileSystemObject")set f=fs.CreateFolder("test")fs.CopyFile "new\*.mdb", "test"set f=nothingset fs=nothingWhen the code executes I get a errorMicrosoft VBScript runtime error '800a0046'Permission denied/adduser_update.asp, line 10Line 10 is set f=fs.CreateFolder("test")I have emailed my hosting company and they say permissions for asp scripts to write to the disk are enabled. what am I doing wrong?ThanksEwen
×