Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old August 7th, 2003, 07:12 PM
madhombre madhombre is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: WI
Posts: 247 madhombre User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
advanced use of images in objects

ok, noone touched my inner html issue so lets try this one.

anyone ever stored an Image inside an object?

I want to declare an object which has an image as one of it's data items.

so I created a constructor which passes the source file in. I tried

this.mypic = new Image();
this.mypic.src = src_in;

I tried

mytmp = new Image();
mytmp.src = src_in;
(which works)
this.mypic = mytmp;
(which does not)

I am trying to scour the docs and also my o'reilly book but I am coming up short here.

any ideas?

Reply With Quote
  #2  
Old August 7th, 2003, 09:23 PM
madhombre madhombre is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: WI
Posts: 247 madhombre User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: advanced use of images in objects

here is a little test

here is the link
http://www.hysteriaweb.net/stuff/temp/jsxmenu2/test.html

do not worry about the graphics, watch the errors.

this is IE only please.

what I do is create an image as part of an object and assign a src to it, then I wish to use that image inside the object functions.

I use a popup alert to test the src is being set, which you see it is, then I in the function I get an error. because the this.mysrc.src (and even this.mysrc) are not defined.

I have used javascript function elsewhere just fine, and I can assign regular variables, just not Images.

what is the deal here????

thanks, hope you guys can help.

here is the code

php Code:
Original - php Code
  1.  
  2. <html>
  3. <head>
  4. <script language="javascript">
  5.  
  6. function test()
  7. {
  8.         this.mysrc = new Image();
  9.         this.mysrc.src = "jsxmfolder.gif";
  10.         alert(this.mysrc.src);
  11.         this.show = show;
  12. }
  13.  
  14. function show()
  15. {
  16.         document.write('<img src="jsxmnone.gif" onLoad="this.src = this.mysrc.src;"></img>');
  17. }                                               
  18. me = new test();
  19. me.show();
  20. </script>
  21. </head>
  22. </html>

Reply With Quote
  #3  
Old September 9th, 2003, 12:56 AM
Matt Matt is offline
Contributing User
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 20 sec
Reputation Power: 6
RE: advanced use of images in objects

Resolved by lack of activity.

Original poster, please place in unresolved status if you still need help.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > advanced use of images in objects


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT