Ir para conteúdo
Fórum Script Brasil

diego_mota

Membros
  • Total de itens

    35
  • Registro em

  • Última visita

Tudo que diego_mota postou

  1. Crystian Está complicado este problema..Infelizmente não funcionou ..ele ao ser "submitado" carrega a imagem padrão: "_izoca.jpg", como se a página sofresse um reload...Eu coloquei no ar o seu código.
  2. Bom amigo, não deu certo a dica que você deu. Ele parece que faz a troca da tag (coloquei um alert para verificar) mas não muda no applet. Talvez seja necessário reinicializar o applet..não sei (até tentei acionar via javascript a função construtora q faz isso dentro do arquivo .class, mas o applet trava..). Dê uma olhada no código no seguinte endereço: http://dhost.info/rebenta/gatas/quebracabeca.htm Abaixo vai o código do .class principal do applet: // Decompiled by DJ v3.7.7.81 Copyright 2004 Atanas Neshkov Date: 27/09/2004 13:39:06 // Source File Name: SlidingPuzzle.java import java.applet.*; import java.awt.*; import java.net.URL; import java.util.Date; import java.util.StringTokenizer; public class SlidingPuzzle extends Applet implements Runnable { public SlidingPuzzle() { t = null; delay = 200; row = 4; col = 4; scramblestart = 0; registered = false; gameover = false; linkto = ""; linkframe = ""; RowText = "Row:"; ColText = "Col:"; } public void init() { super.init(); width = size().width; height = size().height; String s = getParameter("regcode"); s.trim(); s.toUpperCase(); int i = s.charAt(0) - 48; if(i > 9) i -= 7; int j = s.charAt(s.length() - 1) - 48; int k = 0xf423f; if(i + 3 < s.length()) { int l = (new Integer(s.substring(i, i + 3))).intValue(); if(l == 988 && j == (i * 988) % 10) registered = true; } if(!registered) { int j1 = j; j = i; i = j1; if(i + 4 < s.length()) { int i1 = (new Integer(s.substring(i, i + 4))).intValue(); if(i1 == 1027 && j == (i + 1027) % 10) registered = true; } } delay = (new Integer(getParameter("delay"))).intValue(); picfile = getParameter("photo"); scramblestart = (new Integer(getParameter("scramblestart"))).intValue(); int k1 = (new Integer(getParameter("frames"))).intValue(); winfile = getParameter("winfile"); movefile = getParameter("movefile"); int ai[] = parseInt(getParameter("panelbg")); bg = new Color(ai[0], ai[1], ai[2]); ai = parseInt(getParameter("panelfg")); fg = new Color(ai[0], ai[1], ai[2]); ai = parseInt(getParameter("buttonbg")); butbg = new Color(ai[0], ai[1], ai[2]); ai = parseInt(getParameter("buttonfg")); butfg = new Color(ai[0], ai[1], ai[2]); String as[] = parse(getParameter("linkto").trim()); linkto = as[0]; linkframe = as[1]; row = (new Integer(getParameter("row"))).intValue(); col = (new Integer(getParameter("col"))).intValue(); TitleText = getParameter("TitleText"); NewGameText = getParameter("NewGameText"); SolvePuzzleText = getParameter("SolvePuzzleText"); MovesCountText = getParameter("MovesCountText"); BestText = getParameter("BestText"); FinishText = getParameter("FinishText"); winaudio = getAudioClip(getDocumentBase(), winfile); moveaudio = getAudioClip(getDocumentBase(), movefile); readPhoto(picfile); rp = new SlidingPuzzlePhoto(photo, picwidth, picheight, row, col, this); rp.maxtransit = k1; rp.delay = delay; rp.registered = registered; rp.bg = bg; rp.winaudio = winaudio; rp.moveaudio = moveaudio; rp.gameover = gameover; rp.MovesCountText = MovesCountText; rp.FinishText = FinishText; rp.BestText = BestText; rp.repaint(); Panel panel = new Panel(new BorderLayout()); panel.add("Center", rp); setBackground(bg); setForeground(fg); GridBagLayout gridbaglayout = new GridBagLayout(); GridBagConstraints gridbagconstraints = new GridBagConstraints(); gridbagconstraints.fill = 0; gridbagconstraints.gridwidth = 0; gridbagconstraints.anchor = 10; Panel apanel[] = new Panel[5]; for(int l1 = 0; l1 < 5; l1++) apanel[l1] = new Panel(); buttonNew = new SlidingPuzzleButton(80, 20, NewGameText, "Helvetica", 11, butbg, butfg); buttonNew.setBGmain(bg); apanel[0].add(buttonNew); buttonSolve = new SlidingPuzzleButton(80, 20, SolvePuzzleText, "Helvetica", 11, butbg, butfg); buttonSolve.setBGmain(bg); apanel[1].add(buttonSolve); Panel panel1 = new Panel(); panel1.setLayout(new FlowLayout()); for(int i2 = 0; i2 < 2; i2++) panel1.add(apanel[i2]); panel.add("South", panel1); Label label = new Label(TitleText, 1); label.setBackground(bg); label.setForeground(fg); label.setFont(new Font("Helvetica", 1, 20)); panel.add("North", label); add(panel); resize(width, height); show(); repaint(); } public void start() { if(t == null) { t = new Thread(this); t.start(); } } public void stop() { if(t != null && t.isAlive()) t.stop(); t = null; photo = null; rp = null; } public void run() { System.gc(); int i = 0; if(scramblestart > 0) { rp.rescramble(); rp.repaint(); } while(Thread.currentThread() == t) { if(i++ > 1000) { i = 0; System.gc(); } try { Thread.sleep(500L); } catch(InterruptedException interruptedexception) { } rp.repaint(); if(rp.gameover && !linkto.equalsIgnoreCase("none")) { try { URL url = new URL(getDocumentBase(), linkto); getAppletContext().showDocument(url, linkframe); } catch(Exception exception) { exception.printStackTrace(); } rp.gameover = false; } if(!registered) { Date date = new Date(); if(date.getMinutes() % 5 == 0 && date.getSeconds() < 2) try { URL url1 = new URL(getDocumentBase(), "http://www.thejmaker.com/"); getAppletContext().showDocument(url1); } catch(Exception exception1) { exception1.printStackTrace(); } date = null; } } } public void readPhoto(String s) { showStatus("Reading image " + s); photo = null; photo = getImage(getDocumentBase(), s); for(picwidth = picheight = -1; picwidth < 0 || picheight < 0;) { picwidth = photo.getWidth(this); picheight = photo.getHeight(this); try { Thread.sleep(20L); } catch(Exception exception) { } } showStatus("Photo " + s + " (" + picwidth + "x" + picheight + ") ready"); } int[] parseInt(String s) { StringTokenizer stringtokenizer = new StringTokenizer(s, " "); int ai[] = new int[stringtokenizer.countTokens()]; for(int i = 0; i < ai.length; i++) ai[i] = Integer.parseInt(stringtokenizer.nextToken()); return ai; } String[] parse(String s) { StringTokenizer stringtokenizer = new StringTokenizer(s, "|"); String as[] = new String[stringtokenizer.countTokens()]; for(int i = 0; i < as.length; i++) as[i] = stringtokenizer.nextToken(); return as; } public void update(Graphics g) { paint(g); } public void paint(Graphics g) { g.setColor(bg); g.draw3DRect(0, 0, width - 1, height - 1, true); g.draw3DRect(1, 1, width - 3, height - 3, true); } public Insets insets() { return new Insets(0, 0, 0, 0); } public Dimension minimizeSize() { return new Dimension(width, height); } public Dimension preferredSize() { return new Dimension(width, height); } public boolean action(Event event, Object obj) { if(event.target == buttonNew) { rp.target = -1; rp.makePieces(row, col); rp.moves = 0; rp.gameover = false; rp.rescramble(); rp.repaint(); return true; } if(event.target == buttonSolve) { rp.target = -1; rp.resetPositions(); rp.moves = 0; rp.gameover = false; rp.repaint(); return true; } else { return false; } } Image photo; Thread t; int width; int height; int delay; String picfile; int picwidth; int picheight; Color bg; Color fg; Color butbg; Color butfg; int row; int col; int scramblestart; SlidingPuzzleButton buttonNew; SlidingPuzzleButton buttonSolve; SlidingPuzzlePhoto rp; AudioClip winaudio; AudioClip moveaudio; String winfile; String movefile; boolean registered; boolean gameover; String linkto; String linkframe; String TitleText; String NewGameText; String SolvePuzzleText; String RowText; String ColText; String MovesCountText; String FinishText; String BestText; }
  3. Reparei tb que ao verificar o banco no phpadmin, os campos referentes à largura, diretório e altura da imagem estão null...O que pode ser feito para fazer o upload sem problemas? Alterar alguma pasta com chmod??
  4. Até que poderia..mas como eu faria a mudança automática do parâmetro "photo"? Eu usaria a tag div do jeito que já estava tentando? O select não será reescrito e irá selecionar a opção padrão sempre?
  5. oi caros colegas Tenho um Java Applet (fonte do sistema: http://www.thejmaker.com/SlidingPuzzle.html) que faz um joguinho de quebracabeça com uma foto que você fornece como parâmetro, conforme trecho do código abaixo: <param name=photo value="images/praia.jpg"> O meu problema é que gostaria de alterar as fotos toda vez que alguém escolhesse uma foto em um menu "select". Como eu poderia alterar esse parâmetro usando uma caixa select e javascript? O que tentei: Já tentei usar javascript para atualizar o applet inserido em tag div para incluir o applet, mas daí funciona parcialmente: no mozilla/netscape não faz a troca, no ie 5.0 funciona normalmente e no ie 6.0 funciona mas com travamento quando o applet embaralha as peças. É necessário então instalar o J2RE para que funcione no Ie6, o que'torna inviável pedir para que cada internauta faça. Mas, como já vi que nào dá muito certo por esses meios, gostaria de tentar alterar sem usar tag <div>
  6. oi caros colegas Tenho um Java Applet (fonte do sistema: http://www.thejmaker.com/SlidingPuzzle.html) que faz um joguinho de quebracabeça com uma foto que você fornece como parâmetro, conforme trecho do código abaixo: <param name=photo value="images/praia.jpg"> O meu problema é que gostaria de alterar as fotos toda vez que alguém escolhesse uma foto em um menu "select". Como eu poderia alterar esse parâmetro usando uma caixa select e javascript? O que tentei: Já tentei usar javascript para atualizar o applet inserido em tag div para incluir o applet, mas daí funciona parcialmente: no mozilla/netscape não faz a troca, no ie 5.0 funciona normalmente e no ie 6.0 funciona mas com travamento quando o applet embaralha as peças. É necessário então instalar o J2RE para que funcione no Ie6, o que'torna inviável pedir para que cada internauta faça. Mas, como já vi que nào dá muito certo por esses meios, gostaria de tentar alterar sem usar tag <div>
  7. O problema é que não é possível mudar o server..ele é gratuito. http://dhost.info
  8. Pessoal Estou com problemas no upload de imagens. O script posta as notícias, legalzinho até! O problema é que sempre dá erro no upload das imagens. O site onde eu hospedei é http://dhost.info/rebenta/eventos O administrador está configurado como admin senha: supernews
×
×
  • Criar Novo...