Be a Supporter!
Response to: Help With Iframe Getelementbyid("" Posted March 10th, 2010 in Programming

I have found a solution

<html>
 <body>

 <iframe id="testFrame" src="FrameContent.html" ></iframe>

	<a href="#" onclick="getIframeContent('testFrame');">Get the content of Iframe</a>

 </body>

<script>
 function getIframeContent(frameId){
 var frameObj = document.getElementById(frameId);
 var frameContent = frameObj.contentWindow.document.body.innerHTML;
 alert("frame content : "+frameContent);
 }
 </script>

 </html>
Response to: Help With Iframe Getelementbyid("" Posted March 10th, 2010 in Programming

At 3/10/10 06:58 AM, CronoMan wrote: sure you can

var idoc = document.GetElementById("theiframe").con tentWindow.document;

Thank you for your reply

I have tried using the cide you suggested but I get the same result
I have tried using:

var idoc = document.GetElementById("iframeholder").contentWindow.document;
alert(idoc);
alert(document.GetElementById("iframeholder").contentWindow.document);

Hi all

Does anyone know how to pull information out of an iframe?
Below is a example of the code I have

The code imports the iframetable.html file into the iframe (iframetable.html contains text only, no formatting)
When the button is pressed the information from the iframe should be displayed in an alert box, but is not

<html>
<head>
<script>
<!---
function showFrameText()
{

var iframe = document.getElementByID("iframeholder");
alert(iframe);

}
//-->
</script>
</head>
<body>

 <iframe src="iframetable.html" id="iframeholder" name="iframeholder">if you see this you have iframes turned off.</iframe>
 <button onclick="showFrameText()">Show Table Text</button>
 
</body>
</html>

Any help would be greatly appreciated
Thank you

Insert text at a pre-determined pos Posted September 22nd, 2009 in Game Development

Hello all

I am trying to insert text into a text field at a pre-determined position
Below is my code so far:

btn.addEventListener(MouseEvent.CLICK, insert_text);
 function insert_text(event:MouseEvent):void {
  text_display.text += ("information", 10);
 }

If I use code:

text_display.text += "information";

the word information will add to the end of the existing text, but what I want to do is add it at position 10 (meaning 10 characters in)

Can anyone help?

Response to: Flash AS3 Combobox help Posted September 17th, 2009 in Game Development

I have cracked it, when I added the Combobox component to my library the List and TextInput components did not add with it

As soon as I added them it worked

Response to: Flash AS3 Combobox help Posted September 17th, 2009 in Game Development

At 9/17/09 07:22 AM, LeechmasterB wrote: Apparently the error doesn't seem to be in the code you posted, since it works just fine as it is.

So, you tested the code and it worked?

Flash AS3 Combobox help Posted September 17th, 2009 in Game Development

Hi All

I am having trouble populating a Flash AS3 Combobox using an array

import fl.controls.ComboBox;
import fl.data.DataProvider;
	
	var cb:ComboBox = new ComboBox();
	addChild(cb);

	var cssArray:Array = ["a:link ","a:hover ","a:visited ","a:active ","body ",".help-title ",".help-info-title "];

	for (var i = 0; i<cssArray.length; i++) {
		cb.addItem({ label: cssArray[i], data:cssArray[i] })
	}

When I test, the combobox will appear with the first option in the array, when I click the combobox to view the rest of the array i get the following output error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
	at fl.containers::BaseScrollPane/fl.containers:BaseScrollPane::drawBackground()
	at fl.controls::List/fl.controls:List::draw()
	at fl.core::UIComponent/drawNow()
	at fl.controls::List/scrollToIndex()
	at fl.controls::SelectableList/scrollToSelected()
	at fl.controls::ComboBox/open()
	at fl.controls::ComboBox/fl.controls:ComboBox::onToggleListVisibility()
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
	at flash.display::DisplayObjectContainer/removeChild()
	at fl.controls::ComboBox/close()
	at fl.controls::ComboBox/fl.controls:ComboBox::focusOutHandler()

Can anyone see what I am doing wrong?

Populate a combobox from an array Posted September 16th, 2009 in Programming

Hi All

I am having trouble populating a Flash AS3 Combobox using an array

import fl.controls.ComboBox;
import fl.data.DataProvider;
	
	var cb:ComboBox = new ComboBox();
	addChild(cb);

	var cssArray:Array = ["a:link ","a:hover ","a:visited ","a:active ","body ",".help-title ",".help-info-title "];

	for (var i = 0; i<cssArray.length; i++) {
		cb.addItem({ label: cssArray[i], data:cssArray[i] })
	}

When I test, the combobox will appear with the first option in the array, when I click the combobox to view the rest of the array i get the following output error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
	at fl.containers::BaseScrollPane/fl.containers:BaseScrollPane::drawBackground()
	at fl.controls::List/fl.controls:List::draw()
	at fl.core::UIComponent/drawNow()
	at fl.controls::List/scrollToIndex()
	at fl.controls::SelectableList/scrollToSelected()
	at fl.controls::ComboBox/open()
	at fl.controls::ComboBox/fl.controls:ComboBox::onToggleListVisibility()
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
	at flash.display::DisplayObjectContainer/removeChild()
	at fl.controls::ComboBox/close()
	at fl.controls::ComboBox/fl.controls:ComboBox::focusOutHandler()

Can anyone see what I am doing wrong?

Response to: JS link from AS3 Posted August 27th, 2009 in Programming

I have cracked it
If anyone is interested, the code is below

In the HTML page

function jsFunction()
{
document.getElementById('Large').style.display='block';document.getElementById('Small').style.display='none';document.getElementById('Info').style.display='none';
}

AS3 code

import flash.external.ExternalInterface;
flash.system.Security.allowDomain ("*");

mcVideoControls.btnLarge.addEventListener (MouseEvent.CLICK, showlarge);

function showlarge (event:MouseEvent):void
{
var result:Boolean = ExternalInterface.call("jsFunction");
trace (ExternalInterface.available); // Trace = TRUE
}
Response to: JS link from AS3 Posted August 27th, 2009 in Programming

At 8/26/09 08:43 PM, Nano256 wrote: You need to use the ExternalInterface class.

Example:

ExternalInterface.call("alert('Executed from AS3')")

Should display a JavaScript alert message.

Thank you for your reply

The code you suggested works when calling an alert message
But I can't seem to get it to work when trying to call a 'document.getElementById' function

Response to: JS link from AS3 Posted August 26th, 2009 in Programming

At 8/26/09 10:37 AM, GustTheASGuy wrote: You need to set allowscriptaccess when embedding the app.

Thank you for your reply
I have set the allowscriptaccess, but it will still not work

JS link from AS3 Posted August 26th, 2009 in Programming

Hello All

Does anyone know how I can run the following link from AS3?

"javascript:void(0)" onclick = "document.getElementById('Large').style.display='none';document.getElementById('Small').style.display='block';document.getElementById('Info').style.display='block';"

This script is used to hide two CSS DIV's and show one

I have tried some scripts I found on the internet, but they do not seem to work
<script>import flash.net.*;

var js:URLRequest=new URLRequest();
js.url="javascript:document.getElementBy Id('Large').style.display='none';documen t.getElementById('Small').style.display=
'block';document.getElementById('Info').
style.display='block'";

mcVideoControls.btnLarge.addEventListene r(MouseEvent.CLICK, showlarge);

function showlarge(evt:MouseEvent):void
{
navigateToURL(js);
}</script>

Thanks for your help

Response to: Detect hidden IP Posted August 21st, 2009 in Programming

Thanks for your replys

I had a feeling this would be difficult to do

I think I will stick with my IP blocker and add something to my terms and conditions stating I do not condone the use of hidden IP's

Thank you again

Detect hidden IP Posted August 20th, 2009 in Programming

Hello all

Does anyone know if it is possible to detect if someone is trying to hide their IP address when they enter your website?

The reason I am asking this question is, my new website logs IP addresses to prevent misuse

Thanks for your help

Response to: What do you think of my new websit? Posted August 19th, 2009 in General

At 8/19/09 11:05 AM, Ericho wrote: It's a fine website.

Thank you
Finally a sensible comment

Response to: What do you think of my new websit? Posted August 19th, 2009 in General

Wow

Thats why I dont visit the general forum often

ChonkoMonko
This website does not contain any virus

What do you think of my new websit? Posted August 19th, 2009 in General

Hello Newgrounds

I have now finally finished my latest website
FoolsonPhones.com

Now, Newgrounds tends to be a very good place to go for constructive criticism
If anyone would like to take a look at the site and let me know what you think, if you have any comments, suggestions please let me know

Response to: Tom just made 2 frontpage posts and Posted May 22nd, 2009 in General

Its to do with the Flash Portal, I saw it
Did anyone else?

I will say no more

Response to: SHA1 encryption with magic key Posted May 14th, 2009 in Programming

At 5/14/09 07:34 AM, DearonElensar wrote: If it's SHA1 then i can only think of salts, otherwise they might mean a actual encryption (like Blowfish) but i don't know of any that can easily be confused with SHA1.
So ask your source for what they mean :)

Thanks

I have gone back to the person who told me it was SHA1
Hopefully he can clarify this

Response to: SHA1 encryption with magic key Posted May 14th, 2009 in Programming

At 5/14/09 07:11 AM, 25272D wrote: Do you mean a salt? Like, hash with sha1 AND another key?

To be perfectly honest, I dont know
I have been told it is sha1 with magic keys, and im trying to work out how to use it

SHA1 encryption with magic key Posted May 14th, 2009 in Programming

Hello Everyone

Does anyone know how to use Magic Keys in a SHA1 encryption?
I can use the SHA1 encryption (please see below) but I have been given 5 magic keys to use and I dont know how to use them

$str = 'test';
echo sha1($str);

Result:
test = a94a8fe5ccb19ba61c4c0873d391e987982fbbd3

Thanks for your time
SecretDreamer

Response to: Php Mysql Csv Problem Posted May 8th, 2009 in Programming

RESOLVED:

To convert a serial date to format dd/mm/yyyy:

<?
   function convertSerialDate($date)   {
      $timestamp = ($date - 25569) * 86400;
      return date("d/m/Y",$timestamp);
   }
   
   print convertSerialDate(733535); 	// the date you want to convert
?>

To convert format dd/mm/yyyy to a serial number:

<?php
   function date2serial($date) {
      $date_arr = explode('/', $date);
      $std_date = implode(array_reverse($date_arr), '-');
      $timestamp = strtotime($std_date);
      return round(($timestamp + 25569 * 86400) / 86400);
   }

   print  date2serial(08/05/2009);  // the date you want to convert
?>
Response to: Php Mysql Csv Problem Posted May 8th, 2009 in Programming

UPDATE:

I am now one step closer to achieving my goal
I have discovered the 5 digit number generated (39941 = 08/05/2009) is a serial date

Now I have a name for it I should have better luck trying to convert it

Response to: Php Mysql Csv Problem Posted May 7th, 2009 in Programming

At 5/7/09 10:07 AM, liljim wrote: Their website suggests that you can export as HTML as well - what happens when you do that? And could we see a sample entry? You may be able to use your script to open the HTML document, strip out irrelevant tags, stick an xml header at the top of the document and use xml functions to parse the data. It's an awful hack, but short of actually downloading scheduleit to see how it all actually works, I don't know what else to suggest.

Thank you for your continuous help with this

Unfortunately the buil in HTML exporter is not adiquate, it generates a large amount of unwanted data and quite large image maps that I also do no need, unfortunately I cannot generate a sample at the moment

The hack may be possible, but I feel this may increse the processing time
Im going to spend a little more time constructing some sort of code to convert the date

Thanks again

Response to: Php Mysql Csv Problem Posted May 7th, 2009 in Programming

At 5/7/09 12:20 PM, markbscheduleit wrote: Hello,
Just for your info, Since the new version some months ago the program ScheduleIt can output the date in a few formats including the format your need.

Thank you for your reply

Unfortunately with the current echanomic climate the company I work for does not want to spend money upgrading to the new version

Thank you for your suggestion, but unfortunately I will have to continue with my struggle

Response to: Php Mysql Csv Problem Posted May 6th, 2009 in Programming

At 5/6/09 05:54 PM, liljim wrote: This "Scheduleit" - do you h...

Website: http://www.scheduleit.co.uk/

The scheduleit software has a built in exporter and will only export as a .csv file
This exports all data ever entered into the program

This software can run on a single machine or over a network for multiple user access
We run it off a local server as it needs to be accessable by many people

The current process:
I export the data to the .csv file, open the .csv file in Excel and format the date column using custom format yyyy/mm/dd
I then Upload all the data to a MySQL database using an online php form I created
This form will upload the .csv file to a temporary location, load all of the data into the database, then remove the file

I then use a php search function to display the data in the database by date
I use a simple $POST function to handle the search

How I would like it to be:
I want to iliminate the process of formatting the date column in excel
I want to add a bit of code to my upload form to format the date / or format the viewers search to read the date format generated by the scheduleit software

Example line of .csv file:
Bar,385,",190,",Customer,"Information information information",239938,39938,60,660,1,98110 70,,Call,Name,1,"06/01/2009 11:52:54, Name [253]","* 06/01/2009 16:57:19, Name [253]",,0,0,,0,"0,0,1",,0,,,0

I hope this helps

Response to: Php Mysql Csv Problem Posted May 6th, 2009 in Programming

At 5/5/09 11:14 AM, liljim wrote:

Thank you for your reply liljim
Sorry for my late reply, problems with my internet

For personal use, or distribution

This will be used by the compamy I work for, will not be distributed

Show us your table schema.
CREATE TABLE IF NOT EXISTS `schedule` (
  `Header` varchar(30) NOT NULL default '',
  `ID` varchar(6) NOT NULL default '',
  `Owner` varchar(20) NOT NULL default '',
  `Title` varchar(50) NOT NULL default '',
  `SubText` text NOT NULL,
  `DateStart` date NOT NULL default '0000-00-00',
  `DateEnd` date NOT NULL default '0000-00-00',
  `TimeStart` time NOT NULL default '00:00:00',
  `TimeEnd` time NOT NULL default '00:00:00',
  `Style` varchar(25) NOT NULL default '',
  `Colour` varchar(25) NOT NULL default '',
  `Task` varchar(25) NOT NULL default '',
  `TaskName` varchar(25) NOT NULL default '',
  `ResourceName` varchar(25) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Exactly how are you importing the csv into the database? What method are you using?
$sql2 = 'LOAD DATA LOCAL INFILE \'temp/schedule.csv\' REPLACE INTO TABLE `schedule` FIELDS TERMINATED BY \',\' ENCLOSED BY \'"\' ESCAPED BY \'\\\\\' LINES TERMINATED BY \'\\r\\n\'# Affected rows: 645'
. ' '; 
$result2=mysql_query($sql2);
Are you sure the date becomes that exact number? If not, post the exact number.

I am sure of the number, this is the exact number generated

I hope this helps

Response to: Php Mysql Csv Problem Posted May 5th, 2009 in Programming

At 5/5/09 08:23 AM, Deja-Vu wrote: No problems! I take it you have not yet found a solution? Have you tried what I suggested in the previous thread?

No, I have not yet found a solution
I did try opening it in notepad, but the result was the same

I think I need to walk away from this for a few days, that sometimes helps

Response to: Php Mysql Csv Problem Posted May 5th, 2009 in Programming

At 5/5/09 08:11 AM, Deja-Vu wrote:
At 5/5/09 06:55 AM, Wonderful wrote: I swear we had a thread like this a week or so ago. IIRC the answer had to do with the date() function.
You're right: http://www.newgrounds.com/bbs/topic/1052 698

Im so sorry, I forgot I had already asked the question on Newgrounds
My brain has been so fried recently

I apologies

Response to: Php Mysql Csv Problem Posted May 5th, 2009 in Programming

At 5/5/09 06:55 AM, Wonderful wrote: I swear we had a thread like this a week or so ago. IIRC the answer had to do with the date() function.

Thank you for your reply
Im currently reading http://uk.php.net/manual/en/function.dat e.php hopefully this will hold the answer