Datagrid - OnData Or Something?
Hi All, I need my script to somehow detect when the data in a datagrid has been updated [not by the user, like on(Change) but like onData or something] Is there anything that can detect this?
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 11-28-2004, 08:39 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Datagrid - OnData Or Something?
Hi All,
I need my script to somehow detect when the data in a datagrid has been updated [not by the user, like on(Change) but like onData or something]
Is there anything that can detect this?
OnData Help
Hey guys,
I need some help ... I find out a way to get a text file in without using variables ...
example
bCode,bItemName,bDescription,bPics,bPrice
SM,Small Box,16"x12"x12",smallBox.jpg,$1.99
MED,Medium Box,18"x18"x16",mediumBox.jpg,$2.99
this is how I get the data in
code:
var _lv = new LoadVars();
_lv.onData = function(dat) {
var input_arr = dat.split('
');
if (input_arr.length==1) {
input_arr = dat.split('
');
}
for (i=1; i<input_arr.length; i++) {
trace(input_arr[i].split(','));
}
};
_lv.load("testFile2.txt");
he is the issue ...
I'm never going to know how many rows there is going to be at any givin time ...
so what I'm asking is ... I need a way to split each row (once in flash) in its own array ... so that I can take out different indexes ...
I tried using a for loop to it didn't work ...
I'm guessing I need to know how to make dynamic arrays ...
please someone help
thanks
-S
OnData ? For Jpg's
Hi,
I am loading jpg's, and I want to make a Movieclip('MC') invisible when there is no jpg to load (because it just is not there). How can I detect if there is no jpg, and then make the MC invisible? I think I should use onData, but I can't make it work.
Code:
function laadNail3(foto) {
var my_lv:LoadVars = new LoadVars();
my_lv.onData = function(src:String) {
if (src == undefined) {
MC._visible = false;
}
foto = src;
};
my_lv.load(foto, holder);
}
I am also confused where to put the Movieclip that holds the jpg ('holder')?
The data passed to the function comes from another swf, saying:
Code:
laadNail3("b3.jpg");
Could someone show me how to do this?
thank you,
Jerryj.
OnData?
Hey!
is there a way to do something if there's any content loading into your main movie? something like:
Code:
_root.onData = function(){
trace('data is loading');
}
Hope someone knows it
OnData Jpg
Hi,
I am loading jpg's, and I want to make a Movieclip('MC') invisible when there is no jpg to load (because it just is not there). How can I detect if there is no jpg, and then make the MC invisible? I think I should use onData, but I can't make it work.
ActionScript Code:
function laadNail3(foto) { var my_lv:LoadVars = new LoadVars(); my_lv.onData = function(src:String) { if (src == undefined) { MC._visible = false; } foto = src; }; my_lv.load(foto, holder);}
I am also confused where to put the Movieclip that holds the jpg ('holder')?
The data passed to the function comes from another swf, saying:
laadNail3("b3.jpg");[/as][as]
Could someone show me how to do this?
thank you,
Jerryj.
OnData
I have been piecing some code together to try to get this working and am still having some problems, I can get the connection to establish but I cannot get the onData function to work. If anyone has any insight to this it would be greatly appreciated!
function lsOnConnect(success) {
if (success) {
trace ("Connection succeeded!")
} else {
trace ("Connection failed!")
}
}
var socket = new XMLSocket();
socket.onConnect = lsOnConnect
if (!socket.connect('ipnumber', 0000)) {
trace ("Connection failed!")
}
socket.onData = function(success){
if (success){
trace ("loaded");
}
else {
trace("XML did not load");
}
}
OnData?
Hey!
is there a way to do something if there's any content loading into your main movie? something like:
Code:
_root.onData = function(){
trace('data is loading');
}
Hope someone knows it
OnData (?)
am i doing something wrong here or can i not use onData with loadMovie?
Code:
createEmptyMovieClip("target", 1);
target._x = target._y = 100;
target.onData = function () {
trace("movie has been loaded");
};
target.loadMovie("theimage.jpg");
OnData Not Being Called?
myMovieClip.onData = function(){
trace("on data called");
}
myMovieClip.loadMovie("picture.jpg");
why is it not calling onData?
OnData Not Working ?
Hi,
I built the site http://www.jps-foto.de/jps.htm, were a photographer shows his pictures. There are categories with thumbnails, each thumb an individual jpg being loaded by loadMovies. onData should check if they are complete.
On my system it works fine. On other systems (especially slow connections or Macs) sometimes there seem to be are problems. Switching too fast between the categories causes some kind of overload, even the transmission should stop.
At http://www.jps-foto.de/Saupe11test4.swf there is a test showing the player version and some variables at loading.
Does anybody have an idea? I checked the programming carefully, but there was some discussion about old players not loading correctly which should be working now.
It would be a great help to have information on what systems/players this doesn't work.
Mc.onData Problem...
I've tried, on numerous occasions, to use loadMovie with mc.onData = function() {} in MX. However, I can never seem to get it to work. According to the documentation, I can use onData with loadMovie commands to determine when the entire movie has finished loading. Unless my syntax is all screwed up, this doesn't seem to work.
here's a sample
loadMovie("movie.swf","clipName");
clipName.onData = function() {
trace("movie loading done");
}
This always fails...any thoughts?
Cheers
Quasi
OnLoad/onData
Tring to write a dynamic image display for any dimension jpg file.
Code i have written is as follows.
var depth=0
var i=0
createEmptyMovieClip("ImageHolder",depth)
this.onMouseDown=function()
{
loadImage()
}
function loadImage()
{
i++
Mov="Images/Image"+i+".jpg"
ImageHolder.loadMovie(Mov)
ImageHolder.onLoad=checkSize();
}
function checkSize ()
{
trace(ImageHolder._width)
//resize code to go here
ImageHolder._x=0
ImageHolder._y=0
}
loadImage()
this loads OK but the onLoad Event is triggered immediately rather than after Loading of the Image. As i want to change th properties of the ImageHolder Movieclip depending on its new dimensions this is causing a bit of a problem.
Has anyone had any problems with the .onLoad event and solved it, or can see any mistakes i am making.
Any help appreciated
OnData Event Help
thank you first for reading this
i got a little problem about MovieClip.onData event handler
I've check the event invoked when a movie clip receives data from a loadVariables or loadMovie call.
but the problem is
---------------------------
_root.createEmptyMovieClip("testMc",0);
testMc.onData = function(){
trace(this._width);
}
testMc.loadMovie("test.jpg");
------------------------------
didnt work! it only works when AS in onClipEvent(data)
can anyone tell me how to let it invoke?
or onData Event handler only works by use loadVariables?
Has Anybody Got OnData Working?
I've been braking my head for a good while now, trying to use the Movieclip.onData handler. It's supposed to be a listener, right? Why doesn't the following trace a thing??:
Code:
placeholder.onData = function () {
trace ("there's data");
}
loadMovie(temp, placeholder);
My objective, of course, isn't just tracing, but first things first. I've tried a number of other alternatives (always with onData), and none have worked out... anybody's ever gotten this event to work? Can anyone provide an example of code where it does work?
Thanks, everyone!
OnData Trouble
stop();
mc.onData = function() {
if (mc.getBytesLoaded() >= mc.getBytesTotal()) {
play();
}
};
mc.loadMovie(String(newpage)+".swf");
I am using this code to load a new page into a movie clip and check to see that it is entirely load befor playing, the reason i posted this is becuase it doesn't wor. please help
OnData Question
if i create a function using onData, does this occur when the data starts loading, or after it is completed? Testing locally, i am unable to tell the order of operation.
-myk
OnData Problem
I expect the onData function to be called when the jpg is completely loaded but it is not..What am I doing wrong!
Thanks!
this.Back_mc.prototype.loadImage = function()
{
this.createEmptyMovieClip( "instEmpty_mc", 2 );
this.instEmpty_mc.loadMovie( "trio.jpg" )
}
this.instEmpty_mc.onData = function()
{
this.instEmpty_mc._x = 160;
this.instEmpty_mc._y = -220;
this.instEmpty_mc._xscale = 5;
this.instEmpty_mc._yscale = 5;
}
MyMovieClip.onData
For what can be used this method?
Code:
myMovieClip.onData = function () {
trace ("onData called");
};
Thanks Jan
OnData Function?
I am loading external jpgs and swf files in my movie. I am trying to call a function when the external content loads. Right now I am using this code:
Code:
onClipEvent (data) {
//play closing transition
_root.closeTrans();
}
Here is the problem; the on data is unreliable. Sometimes it calls the function twice, or too early. What else can I do to call the action when the data finishes loading?
Flash 5 And OnData
can any 1 explain me for which o when do i use the
MC.onData event, and if some 1 have an example code its great too!
on flash 5!!!
thnaks i nadvance
peleg
OnData Or OnLoad?
Hi there!
Since some time ago, I have developed a lot of Flash projects with database integration (even in PHP as will in ASP).
Though, there is something that bugs me... onData and onLoad events used in LoadVars. As you already know, the basic method to access an external script is:
PHP Code:
DataSender = new LoadVars();
DataReceiver = new LoadVars();
// put here the function to receive data sent back
DataSender.sendAndLoad ("scriptname",DataReceiver,"POST");
However you need to get ready to receive the data sent back to Flash (as commented above), by the script. Well, normally, I do that by using onLoad event, this way:
PHP Code:
DataReceiver.onLoad = function()
{ trace (dataReceiver);}
Ok, it works like a clock. However, it the server fails, sometimes Flash keep trying and waiting forever.
Then, I found out that using onData event, you can prevent server timeout, this way:
PHP Code:
DataReceiver.onData = function(src)
{
if (src == undefined)
{ trace ("server failed"); }
else
{ trace ("ok"); }
}
The problem is that, if you use onLoad you cannot prevent server failure. However if you use onData, you CAN prevent server failure but DataReceiver will not be loaded with content sent back to Flash for the script.
Anyone there know how to deal with that?
Synchronous OnData
I'm building a quiz in flash. After each question is answered, I send the result to the database to record the answer and return a count of what others have answered for each answer. Something like this:
Quote:
var target_xml:XML = new XML();
target_xml.onData = function(src:String) {
if (src == undefined){ version.text = "Error getting results";
} else {
var src_xml:XML = new XML();
src_xml.ignoreWhite = true;
src_xml.parseXML(src);
var aryTemp:Array = new Array;
for (var a:XMLNode = src_xml.firstChild.childNodes[2].childNodes[0], j=0; a!=null; a=a.nextSibling,j++) {
aryTemp.push(a.childNodes[1].childNodes[0].toString());
}
resultsArray.push(aryTemp);
totalArray.push(src_xml.firstChild.childNodes[1].childNodes[0].toString());
if (qPosition == qCount) {
qPosition = 0;
nextFrame();
};
}; //end success boolean
};
resultsXML.sendAndLoad("http://www.quizical.net/histories", target_xml);
The resultsArray stores the selected count of each answer. The totalArray stores a count of how many times the question has been answered. So in a quiz that has 5 questions, my resultsArray.length would be 5 and my totalArray.length would be 5. When I'm presenting the results of each question, I use a position counter to access the right total count from totalArray, like totalArray[questionNumber].
The problem is that occassionally the results of one question are loaded and parsed faster than the previous one and its results get placed in the count arrays before the previous one. Basically the results get out of order sometimes.
My question is how can I ensure that the next question is not processed before the current question is processed? I tried using onLoad instead of onData since onLoad seems to also include parsing rather than just receiving the data. This piece happens in the background while the student is taken the quiz.
XmlSocket / OnData
Like many others before me, I am having problems with the xmlSocket object and specifically with the onData event not firing.
Object defined thus:
Code:
myXML = new XMLSocket;
myXML.onConnect = handleConnect;
myXML.onClose = handleDisconnect;
myXML.onData = handleData;
myXML.connect("localhost", 9090);
function handleData() {
trace("data");
}
(I left out the other functions but they are defined).
My socket server is set up to send back a simple welcome message when a client connects. Using Telnet I can connect and get the welcome message back. In Flash I connect and nothing... or at least onData doesn't fire.
Checking the log my server generates tells me it is sending the message to Flash.
I've read the past posts on this subject and it seems everyone says something along the lines of "the string needs to be terminated by a null byte" and in my server (written in PHP) I've tried " |