Hello, I'm facing here one strange behaviour. If I publish my movie, and click on my button, flash opens the output window to say error: can't load file at http:// localhost/etc Until here, everything is ok, he can't run whithout being in http docs unther apache. Now I go to browser, and when clicking in my button, nothing hapens. The most bizarre of this is that if I don't fill my textfield, it works, filling it it doesn't. I've checked all, have tracede the content of the textfield and it is ok, outside the browser... What should I do? I must say that my textfield is inside one movieclip Thanks _root.folha.arquivar.onRelease = function() { orcamento= _root.folha.scroll_.orcamento_i.text; la = new LoadVars(); la.load("php/arquivar_orcamentos.php?"+sem_cache+"&"+orcamento); la.onLoad = function(sucesso) { if (sucesso) { getURL("javascript:alert('O or?amento foi arquivado com sucesso.')"); } }; };
Hello Kglad, many thanks for reply me! No, I think the problem is not any convertion from numeric to string. I'm creating one movieclip whitch will have one textfield and one scrollbar in it just like the code I'm now posting. Then I'm using the loadvars object to pass the text into php I just don't see wht's wrong. If I change this line: _root.folha.scroll_.orcamento_i.text = ""; to: _root.folha.scroll_.orcamento_i.text = "Testing"; the loadfunction works, but now I can't insert text into my textfield... strange, isn't it? Many thanks again for help! _root.folha.createEmptyMovieClip("scroll_", 260); _root.folha.scroll_._x = 105; _root.folha.scroll_._y = 207.5; _root.folha.scroll_.createTextField("orcamento_i", 261, 0, 0, 285, 350); _root.folha.scroll_.orcamento_i.embedFonts = true; _root.folha.scroll_.orcamento_i.text = ""; _root.folha.scroll_.orcamento_i.multiline = true; _root.folha.scroll_.orcamento_i.wordWrap = true; _root.folha.scroll_.orcamento_i.border = true; _root.folha.scroll_.orcamento_i.borderColor = 0xB2B2B2; _root.folha.scroll_.orcamento_i.selectable = true; _root.folha.scroll_.orcamento_i.type = "input"; _root.folha.scroll_.orcamento_i.setNewTextFormat(f_orcamentos); //******************************************// // this is for my scrollbar work // //******************************************// parametros = {texto:"orcamento_i", tamanho:8, corSombra:"0x000000", redeSombra:35, contorno:0, corContorno:"0xB2B2B2", cor:"0xFF7223", rede:100, contornoOver:0, corContornoOver:"0xFF7223", corOver:"0xB2B2B2", redeOver:100, corContornoSetas:"0xFFFFFF", corSetas:"0xFFFFFF", redeSetas:100}; // _root.folha.scroll_.attachMovie("elevador", "elevador_orcamento_i", 262, parametros); _root.folha.scroll_.elevador_orcamento_i._x = 0; _root.folha.scroll_.elevador_orcamento_i._y = 0;
what if you use: _root.folha.arquivar.onRelease = function() { la.sem_cache=sem_cache; la.orcamento= _root.folha.scroll_.orcamento_i.text; la = new LoadVars(); la.sendAndLoad("php/arquivar_orcamentos.php"); la.onLoad = function(sucesso) { if (sucesso) { getURL("javascript:alert('O or?amento foi arquivado com sucesso.')"); } }; };
oops, that's not right: _root.folha.arquivar.onRelease = function() { la = new LoadVars(); la.sem_cache=sem_cache; la.orcamento= _root.folha.scroll_.orcamento_i.text; la.sendAndLoad("php/arquivar_orcamentos.php"); la.onLoad = function(sucesso) { if (sucesso) { getURL("javascript:alert('O or?amento foi arquivado com sucesso.')"); } }; };
Hello Kglad, again, thanks for help :-) ok, I found the bug, but this is now even more strange... the problem is indeed what you've mentioned in your first post, is the argument I'm passing to my scrollbar that is causing this confusion, but the very stange here is that sometimes this work and others don't... I've build one scrollbar component using draw api and I pass the name of the textfield i want to scroll like this: parametros = {texto:"orcamento_i", tamanho:8, corSombra:"0x000000", redeSombra:35, contorno:0, corContorno:"0xB2B2B2", cor:"0xFF7223", rede:100, contornoOver:0, corContornoOver:"0xFF7223", corOver:"0xB2B2B2", redeOver:100, corContornoSetas:"0xFFFFFF", corSetas:"0xFFFFFF", redeSetas:100}; whith this parametros I define the text to be scrolable, and the colors and alphas i want my scrollbar to have. inside the component I have this litle code: r = _root; e = this; l = e.getNextHighestDepth(); e.texto = _parent[texto]; e.onEnterFrame = function() { if (e.texto.maxscroll == 1) { stop(); } else { gotoAndStop(2); } }; stop(); Do you think this would be my problem? there aren't any repetitions of variables, the name of the textfield is passed whith the 'texto', whose maxscroll is then checked... I'm a litle confused here :-) Many thanks! P.S. - Note that if I pass the name of textfield using _root.folha.scroll_.orcamento_i.text the scrollbar doesn't fire, but all the code works great
i don't see any problem with your component code, but if you're still using that load statement: la.load("php/arquivar_orcamentos.php?"+sem_cache+"&"+orcamento); you're going to continue to have problems. you've already established that there's a problem because of some change to orcamento. so, why append that variable in the load call? why don't you pass those variables instead of trying to append them as mentioned in my previous post?
I've tryed but styll doesn't work, and I now now the problem is the scrollbar if my text maxscroll == 1, it flash loads the php perfectly, if maxscroll != 1 he just don't work anymore. I've been using this component for months, and I had never a problem whith it, i'm going to check all the code again to see if I found the bug Many thanks! Happy new year for you and your family, ok?
Hello NSurveyor, thanks for reply in the second frame of component I have the draw api functions to create the scrollbar using that 'parametros' I'm passing. like this code: r = _root; e = this; // function desenhar_scroll_() { e.createEmptyMovieClip("sombra", level); e.sombra._x = e.texto._width+tamanho; e.sombra.beginFill(corSombra, redeSombra); e.sombra.lineTo(0, tamanho); e.sombra.lineTo(tamanho, tamanho); e.sombra.lineTo(tamanho, 0); e.sombra.lineTo(0, 0); e.sombra.endFill(); e.sombra.tabEnabled = false; // e.sombra.createEmptyMovieClip("topo", this+1); e.sombra.topo._x = -1; e.sombra.topo._y = -1; e.sombra.topo.lineStyle(contorno, corContorno, 100); e.sombra.topo.beginFill(cor, rede); e.sombra.topo.lineTo(0, tamanho); e.sombra.topo.lineTo(tamanho, tamanho); e.sombra.topo.lineTo(tamanho, 0); e.sombra.topo.lineTo(0, 0); e.sombra.topo.endFill(); e.sombra.topo.tabEnabled = false; // e.createEmptyMovieClip("sombraBaixo", level+1); e.sombraBaixo._x = e.texto._width+tamanho; e.sombraBaixo._y = e.texto._height-tamanho; e.sombraBaixo.beginFill(corSombra, redeSombra); e.sombraBaixo.lineTo(0, tamanho); e.sombraBaixo.lineTo(tamanho, tamanho); e.sombraBaixo.lineTo(tamanho, 0); e.sombraBaixo.lineTo(0, 0); e.sombraBaixo.endFill(); e.sombraBaixo.tabEnabled = false; // e.sombraBaixo.createEmptyMovieClip("base", this+1); e.sombraBaixo.base._x = -1; e.sombraBaixo.base._y = -1; e.sombraBaixo.base.lineStyle(contorno, corContorno, 100); e.sombraBaixo.base.beginFill(cor, rede); e.sombraBaixo.base.lineTo(0, tamanho); e.sombraBaixo.base.lineTo(tamanho, tamanho); e.sombraBaixo.base.lineTo(tamanho, 0); e.sombraBaixo.base.lineTo(0, 0); e.sombraBaixo.topo.endFill(); e.sombraBaixo.topo.tabEnabled = false; // function scrollBtns(linhas) { e.texto.scroll += linhas; } // e.sombra.topo.onRollOver = function() { e.sombra.topo.lineStyle(contornoOver, corContornoOver, 100); e.sombra.topo.beginFill(corOver, redeOver); e.sombra.topo.lineTo(0, tamanho); e.sombra.topo.lineTo(tamanho, tamanho); e.sombra.topo.lineTo(tamanho, 0); e.sombra.topo.lineTo(0, 0); e.sombra.topo.endFill(); }; // e.sombra.topo.onRollOut = function() { e.sombra.topo.lineStyle(contorno, corContorno, 100); e.sombra.topo.beginFill(cor, rede); e.sombra.topo.lineTo(0, tamanho); e.sombra.topo.lineTo(tamanho, tamanho); e.sombra.topo.lineTo(tamanho, 0); e.sombra.topo.lineTo(0, 0); e.sombra.topo.endFill(); }; // e.sombra.topo.onPress = function() { e.texto.scroll--; scrollTopo = setInterval(scrollBtns, 250, -1); Subir_Ascensor(); scrollAscensorTopo = setInterval(Subir_Ascensor, 250, -1); }; // e.sombra.topo.onRelease = function() { clearInterval(scrollTopo); clearInterval(scrollAscensorTopo); }; // e.sombraBaixo.base.onRollOver = function() { e.sombraBaixo.base.lineStyle(contornoOver, corContornoOver, 100); e.sombraBaixo.base.beginFill(corOver, redeOver); e.sombraBaixo.base.lineTo(0, tamanho); e.sombraBaixo.base.lineTo(tamanho, tamanho); e.sombraBaixo.base.lineTo(tamanho, 0); e.sombraBaixo.base.lineTo(0, 0); e.sombraBaixo.base.endFill(); }; // e.sombraBaixo.base.onRollOut = function() { e.sombraBaixo.base.lineStyle(contorno, corContorno, 100); e.sombraBaixo.base.beginFill(cor, rede); e.sombraBaixo.base.lineTo(0, tamanho); e.sombraBaixo.base.lineTo(tamanho, tamanho); e.sombraBaixo.base.lineTo(tamanho, 0); e.sombraBaixo.base.lineTo(0, 0); e.sombraBaixo.base.endFill(); }; // e.sombraBaixo.base.onPress = function() { e.texto.scroll++; scrollBase = setInterval(scrollBtns, 250, 1); Descer_Ascensor(); scrollAscensorBase = setInterval(Descer_Ascensor, 250, -1); }; // e.sombraBaixo.base.onRelease = function() { clearInterval(scrollBase); clearInterval(scrollAscensorBase); }; } stop(); desenhar_scroll_();
pluda, i know you want to take a different approach to correcting the problem so run with it. if you can't find the problem and want to try approaching from the failed sendAndLoad() statement, let me know.
Hello, <pluda, i know you want to take a different approach to correcting the problem so run with it. if you can't find the problem and want to try approaching from the failed sendAndLoad() statement, let me know.> Thanks Kglad! The problem here is not using load or sendAndLoad, this is indeed strange I'm making here some tests and found this: removing my component from lybrary, i still get the problem If I just insert 1 to 23 lines of text in my textfield, it works great, there is no need to use any scrollbar. I my text exceds 24 lines it just not work anymore, even if in flash mode I get the output error saying flash can't load the php and tracing the entire text. would it be ny limitation to the maximum nunber of lines the textfield suports? We are talking abaut one input text field Thanks!
i really didn't want to debug your component. that's why i want to approach from the sendAndLoad() side of your code. if you use: _root.folha.arquivar.onRelease = function() { la = new LoadVars(); la.sem_cache=sem_cache; la.orcamento= _root.folha.scroll_.orcamento_i.text; la.sendAndLoad("php/arquivar_orcamentos.php"); la.onLoad = function(sucesso) { if (sucesso) { getURL("javascript:alert('O or?amento foi arquivado com sucesso.')"); } }; }; what happns?
Hello, < what happns? > Well, nothing... the button on onRelease doesn't fire anything, either in flash environemet or browser. In fact, this is not the first time I try use sendAndLoad and I never get any result... Adding one trace to the onRelease function I get the text of textfeild outputed, but not the usual error saying that flash can't load the php file Just like this: _root.folha.arquivar.onRelease = function() { la = new LoadVars(); la.sem_cache = sem_cache; la.orcamento = _root.folha.loader_texto.orcamento_i.text; trace( _root.folha.loader_texto.orcamento_i.text); la.sendAndLoad("php/arquivar_orcamentos.php"); la.onLoad = function(sucesso) { if (sucesso) { getURL("javascript:alert('O or?amento foi arquivado com sucesso.')"); } }; }; the output window displays this Hello, this is one test using sendAndLoad But if I use load instead I get this in output window Hello, this is one test using load Error opening URL "file:///Hd/Users/hugo/Mataborr?o%20Designers/Projectos%20internos%20em%20curso/ php/arquivar_orcamentos.php"
Sorry Kglad, what do you mean by that < you php script is not executing to completion > The php is outputing one echo if he suceeds this one: echo("registo efectuado"); otherwise the getUrl comand in flash doesn't fire If this echo is received, flash outputs the javaScript alert, if not it doesn't. I'm cuting of my hair! :-)
ok, lets go into parts :-) I'm sure the php and the onLoad statment are working correctly, because if I enter per exemple 15 lines of text, the load works, php echoes ok and javascript is fired (this is all in browser). Now if I copy/paste per exemple 50 lines of text, the scrollbar is fired and nothing works anymore (my textfield _height = 350 suports 23 visible lines, after 24 the scrollbar is fired) this all hapens using browser and LOAD using SendAndLoad, both in flash environment or browser, nothing hapens, and flash does not even call the php
no, it probably won't. the problem is the file name's length. use: root.folha.arquivar.onRelease = function() { la = new LoadVars(); la.sem_cache=sem_cache; la.orcamento= _root.folha.scroll_.orcamento_i.text; la.sendAndLoad("php/arquivar_orcamentos.php",la,"POST"); la.onLoad = function(sucesso) { if (sucesso) { getURL("javascript:alert('O or?amento foi arquivado com sucesso.')"); } }; }; and if that fails try it with "GET".
I'm really sorry Kglad, it does not work...
Hello! < ok, you tested that in the flash test environment and the onLoad handler failed > In flash environment it always fail, flash doesn't load php in test movie. Using browser and LOAD , the php echoes sucess if he sucessfully inserts text into MySql database, otherwise he does not echo anything and flash doesn't run the javascrip Alert Like this: if php outputs this: echo("registo efectuado"); Flash runs this: la.onLoad = function(sucesso) { if (sucesso) { getURL("javascript:alert('O orcamento foi arquivado com sucesso.')"); } }; Else he does nothing Thanks again for try helping me here! :-)
the length of orcamento is more likely the cause of the problem than the script that creates your scrollbar. it would still be helpful to comment out the creation of that scrollbar when you have a lot of text and check that all works as expected. what does your php script do with orcamento? why would that variable having an outrageous length cause a problem?
Hello! < what does your php script do with orcamento? why would that variable having an outrageous length cause a problem? Print this message > Well, php receives the text and stores him in my database. Just that. the text lenght may be biguer because this is part of my the software I'm developing to manage billings, clients etc in my company. Or?amento is where i do the briefing of my works, so it can have 5 lines or he can have 50 :-) But this is indeed one strange behaviour, isn't it?
< have you pinpointed the problem > I'm sorry, pinpointed? is this localized?
to track your problem you need to eliminate possible problems so we can focus on the problem area. before spending a lot of time looking at your scrollbar creation code, i would suggest commenting out the creation of your scrollbar and seeing if the problem still persists.
Kglad, I just don't know how to thank you! You were always wright, my mistake was this: instead of _root I had in one line root here: _root.folha.arquivar.onRelease = function() { I had root.folha.arquivar.onRelease = function() { Of course this would never work! I'm really sorry for waisting your time, it was indeed my mistake! Sorry and thanks! Now, Indeed this works good using the code you give me whith sendAndLoad Why? what is the big diference between sendAndLoad and just load? Thank you so much, I was thinking this would ever work anymore!
you're welcome. to send variables with just a load statment you needed to append them to the file name and there's a limit to how much length you can append to a file name. it seemed probable that you were hitting that limit. with sendAndLoad() you can send variables without appending them to the file name. that would avoid the problem of excess length.
such mistakes would be picked up immediately if Flash provided an option to report undefined variables (like 'root') as an error (or warning) when you play. Flash is not terribly helpful when it comes to easy to make scripting errors like that (unlike some other programs) -- All the best, Jeckyl
Don't see what you're looking for? Try a search.
|