View Single Post
Old 07-27-2007, 06:42 AM   PM User | #2
StupidRalph
Senior Coder

 
Join Date: Mar 2003
Location: Atlanta
Posts: 1,037
Thanks: 14
Thanked 30 Times in 28 Posts
StupidRalph is on a distinguished road
Sometimes...I feel like I'm on my own...j/k. I fixed it. Apparently was overthinking this and wanted to query the DB to find out the rating once it posted. When thats simply not necessary since I can call javascript directly from actionscript. So really all that needed to be done is write a function on the parent page (genre.php) and pass the parameters via actionscript.

genre.php
Code:
//code that opens the child window container my mp3 player
function launchPlayer(id,title){
	genre=<?=$genre;?>  //variable set via PHP
	player= window.open ('player2.php?id='+id+'&genre='+genre, title,'location=0,status=0,scrollbars=0,menubar=no,resizable=no,width=480,height=250');
}


//this is the function I added to the parent page.
function updateRate(id,rating){
	//each rate image id is named 'rate' + its primary key from the database. (for example: <img id="rate1111" src="images/headphones.gif" />)
	window.document.getElementById(id).src = 'images/headphones'+ rating +'.gif';
}
player.php
Code:
//this is how I call that function from my actionscript
getURL("javascript: window.opener.updateRate('rate"+ songID + "','" + this.rate_value + "');");
And there you have it. Sometimes you just need to back away from your problems and revisit with a clear mind .
__________________
Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.
StupidRalph is offline   Reply With Quote