Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Trying to change object.src
Old 05-20-2009, 01:31 PM Trying to change object.src
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
Here is my code:

Code:
 
function OrbCreator(){
  var b;
 b=document.createElement("<img src='./images/Orb.png' style='position:absolute; display:none; left:10000px; top:0px; width:"+(2*Orbsize)+"px; height:"+(2*Orbsize)+"px;'>");
 this.is=b.style;
  this.src=b.src;
  this.move=moveOrb;
  document.getElementById("container").appendChild(b);
 this.is.display='block';
}
 
function moveOrb(x,y,z){
  this.is.width=2*Os;
  this.is.height=2*Os;
  this.is.left=x-Os;
  this.is.top=y-Os;
  this.is.zIndex=z;
  if(this.renew==true){
   this.renew=false;
   this.src="./images/NewImage.png";
  }
}
What am I doing wrong?

P.S. site url:
http://huduzu.trollnest.com
__________________
Sleeping Troll, EMUSE, Mind Expansion...Truly serendipity!

Last edited by Sleeping Troll; 05-20-2009 at 02:29 PM..
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-20-2009, 02:23 PM Re: Trying to change object.src
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Using document.createElement like that doesn't work in Firefox.
__________________
Join me on
Please login or register to view this content. Registration is FREE

Last edited by wayfarer07; 05-20-2009 at 02:25 PM..
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 05-20-2009, 02:28 PM Re: Trying to change object.src
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
You again!!!, yeah but that is perfunctory... immediate prob is the image update.
__________________
Sleeping Troll, EMUSE, Mind Expansion...Truly serendipity!
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
Old 05-20-2009, 04:06 PM Re: Trying to change object.src
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
I can't tell much from that code. It depends on what "this" is referring to. Are these functions being be used as constructors, or being triggered by an event of some sort?
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 05-20-2009, 05:13 PM Re: Trying to change object.src
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
Orb[a].move(px[a],py[a],pz[a]); Have you looked at the site, that should make it much clearer than perusing tons of code... but if you like, I can post the entire script?
var Orb=new Array();
__________________
Sleeping Troll, EMUSE, Mind Expansion...Truly serendipity!

Last edited by Sleeping Troll; 05-20-2009 at 05:39 PM..
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
Old 05-20-2009, 05:18 PM Re: Trying to change object.src
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Sorry, the whole page isn't working for me in Firefox, and I don't really know what that means.

Maybe if you make a really simple example of what isn't working you'll be able to figure it out.
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Reply     « Reply to Trying to change object.src
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20052 seconds with 12 queries