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

2011/10/5

Open Url in browser

Zocker1996 Zocker1996

2011/10/5

#
Hi guys... I have used google and foudn many sulutions but no worked for me... so I am here now. I wan't that if you click on the actor the browser: import greenfoot.*; import java.net.*; import java.io.*; public class regeln extends Actor { public void act() { if(Greenfoot.mousePressed(this)) { ######## OPEN "http://www.youtube.com/watch?v=roAaqPXERsw" ############ } } }
actinium actinium

2011/10/5

#
Its not that simple zocker. The act method is like a thread that executes so many times a second. Even if you could open a browser this way you would quickly clog up your system opening the same page in a new instance of the browser. Greenfoot is mostly used for games and scientific simulations.
Zocker1996 Zocker1996

2011/10/5

#
hm ok... but is there any way to play a video?
Zocker1996 Zocker1996

2011/10/5

#
so now i have convertet it to a !!!GIF!!!! and it work fine... i use http://www.greenfoot.org/scenarios/260 to use the gif... now there is a loop. so i need to remove tha actor after it hast finished. to do that is shuld use a timer or something. the gif is 21 seconds ... how i make a timer????
You need to login to post a reply.