This site requires JavaScript, please enable it in your browser!
Greenfoot back
trias95
trias95 wrote ...

2015/1/29

Iframe Greenfoot game to present on my own site?

trias95 trias95

2015/1/29

#
Hey there, im looking to make a website based portfolio of some of the work ive done ready for uni. Im wanting to have a games tab and have an iframe to the game i made in greenfoot. Im aware this may not be the best place to ask however, someone may know.. Is it possible to do it through a standard Iframe or, better yet, is it possible to actually "host" the game on my site in the same way this site hosts games? Thanks in advance
lordhershey lordhershey

2015/1/29

#
Use the export to web page feature. I put one on my site like this Helicopter game made in greenfoot hosted on different site You get the jar files and all of the supporting html stuff you need.
trias95 trias95

2015/1/29

#
Where would i find that? on the GF client or on the website because if its the client, i dont have the game files locally anymore and i didnt enable downloads from the GF website :s
lordhershey lordhershey

2015/1/29

#
GF ide it is the share button, at the top are 3 options, publish, webpage and application, click the webpage tab.
trias95 trias95

2015/1/29

#
I see that on the IDE however, the project, i dont have a copy of it and i didnt make it so that you can open in greenfoot.. is there any way i can get it back? :S
lordhershey lordhershey

2015/1/30

#
Is this the 666 days in hell game? You could probably figure out what the jar name is and pull it out, copy the applet tag and there you would have it. Diggin at the game page the jar file can be downloaded www.greenfoot.org/applet_attachments/0002/7925/greenfoot6619984432213746490.jar and the html code you will need to load it is on the page source as well: <applet code="greenfoot.export.GreenfootScenarioViewer.class" width="818" height="670" archive="Hosted Path/greenfoot6619984432213746490.jar" </applet> Not 100% sure if that will work. but looking at that jar looks like it has all classes and and assets in there.
trias95 trias95

2015/1/30

#
Thank you very much, ill have a dig with that now :)
trias95 trias95

2015/1/30

#
SPOT ON! you sir, are a life saver <3
trias95 trias95

2015/1/30

#
Okay, hope you dont mind but i'd like to pick your brains just a little more. I can now see the java frame, ive added an exception for it in my java control panel however when i hit run now, i get a null pointer exception, the frame goes while and just has that little red "click for details" thing in the top left. These are the details of the exception.
Java Plug-in 11.31.2.13
Using JRE version 1.8.0_31-b13 Java HotSpot(TM) Client VM
User home directory = C:\Users\joel
----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
l:   dump classloader list
m:   print memory usage
o:   trigger logging
q:   hide console
r:   reload policy configuration
s:   dump system and deployment properties
t:   dump thread list
v:   dump thread stack
x:   clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
CacheEntry[file:/G:/FirestormEntertainment/666.jar]: updateAvailable=false,lastModified=Fri Jan 30 06:18:46 GMT 2015,length=16389787
0
Any ideas? Thanks
davmac davmac

2015/1/30

#
These are the details of the exception.
Err, no they're not :p That's not a stack trace or exception message. This:
file:/G:/FirestormEntertainment/666.jar
Looks like you are trying to run an applet from your local filesystem, which is normally not possible.
trias95 trias95

2015/1/30

#
I see so i cant preview it without first uploading it to a webhost?
lordhershey lordhershey

2015/1/30

#
You can, download Apache for windows. Make your site in the sub directory htdocs (this is the webroot) you would access you web page by going to 127.0.0.1/index.html (not by clucking the web doc in explorer)
trias95 trias95

2015/1/31

#
Ive uploaded it to a domain i own and am hosting it there now for testing purposes however i still seem to get a null pointer exception? Can you guys se the game and or play it? does it give you an error message or is it just me? http://www.eyeofazshara.co.uk/666-Days-In-Hell.php Thanks
lordhershey lordhershey

2015/1/31

#
it looks like it is trying to call out to both the greenfoot.org site as well as yours - we are getting a security Exception of some sort. if you want to go a sub frame route that would be doable - you could possibly also use a dynamic script tag - or maybe the classes can be extracted and added to a dummy project - basically make a fake project with same class names and then patch in the classes you want over the dummy ones.
You need to login to post a reply.