Volledige versie bekijken : Flash 8 met Mysql
ikkepatrick
%Europe/Berlin %623 %2006, 14:57
Ik probeer met Flash 8 een koppeling te krijgen naar mijn Mysql database te maken maar tijdens het starten van de movie zegt hij
**Error** Symbol=fDataSet, layer=Layer 1, frame=1:Line 8: Syntax error. u += "?magic=" add ((getTimer()*random(10000))+random(1000));
Dit zit in de Fdataset, wie weet hier een oplossing op?
theFlashWizard
%Europe/Berlin %636 %2006, 15:16
een ( te weinig of een ) teveel ;)
kijk maar eens goed :)
TheZwier
%Europe/Berlin %638 %2006, 15:19
een ( te weinig of een ) teveel ;)
kijk maar eens goed :)
De ( en )`s kloppen precies hoor.
Misschien kan je iets meer code geven patrick?
Flasher
%Europe/Berlin %638 %2006, 15:20
de 'add' operator, die overigens al een versie of drie deprecated was, werkt in flash 8 echt niet meer. Je moet '+' gebruiken.
Het aantal haakjes klopt volgens mij wel hoor.
theFlashWizard
%Europe/Berlin %648 %2006, 15:33
u += "?magic=" add ((getTimer()*random(10000))+random(1000));
die heeft toch geen begin haakje?
en anders.. em.. sorry.
Syntax error geeft trouwens over het aan dat je een soort typfout hebt gemaakt.
ikkepatrick
%Europe/Berlin %650 %2006, 15:36
Dankjewel flasher, het was idd de add die vervangen moest worden door een +. Nu had ik nog een vraag wat houd de volgende foutmeldingen in ?
**Error** \\server1\khbikes\test mysql\NetServices.as: Line 22: Classes may only be defined in external ActionScript 2.0 class scripts.
class mx.remoting.NetServices extends Object
**Error** \\server1\khbikes\test mysql\NetServices.as: Line 68: The class or interface 'mx.remoting.Connection' could not be loaded.
{
**Error** \\server1\khbikes\test mysql\NetServices.as: Line 93: The class or interface 'mx.remoting.Connection' could not be loaded.
var nc = new Connection();
**Error** \\server1\khbikes\test mysql\NetServices.as: Line 109: The class or interface 'mx.remoting.Connection' could not be loaded.
public static function getConnection( uri:String ):Connection {
Roenes
%Europe/Berlin %686 %2006, 16:28
OF je hebt een class gedefineerd in flash zelf en niet in een .as bestand OF je probeert een class te gebruiken zonder eerst de juiste package te importeren. Als het beide niet is, toon dan wederom wat meer code. Want met puur wat foutmeldingen zonder de gehele code kunnen wij ook niet echt veel... ;)
ikkepatrick
%Europe/Berlin %688 %2006, 16:31
OF je hebt een class gedefineerd in flash zelf en niet in een .as bestand OF je probeert een class te gebruiken zonder eerst de juiste package te importeren. Als het beide niet is, toon dan wederom wat meer code. Want met puur wat foutmeldingen zonder de gehele code kunnen wij ook niet echt veel... ;)
Het gaat erom dat ik eerste gewoon de gegevens uit de database kan lezen
Hierbij de code
#include "NetServices.as"
MyData.Load("fdsData.php");
var id = setInterval(MaakMenu, 400);
function MaakMenu() {
if (MyData.loaded == true) {
for (i = 0; i < MyData.RecordCount; i++) {
duplicateMovieClip(MenuItem, "MenuItem" + i, i);
setProperty("MenuItem" + i, _y, (i*20) + 75);
setProperty("MenuItem" + i, _x, 25);
eval("MenuItem" +i).Omschrijving = MyData.recordset[i]["Category"];
eval("MenuItem" +i).Klasse = MyData.recordset[i]["ID"];
tekst = "hij komt er langs"
clearInterval(id);
}
}
}
EN dit is de code in de fdataset
#initclip
function fDataSetClass() {
this.initialize();
}
fDataSetClass.prototype = new MovieClip();
//public methods
fDataSetClass.prototype.load = function(u) {
u += "?magic=" + ((getTimer()*random(10000))+random(1000));
this.loadVariables(u, "POST");
};
fDataSetClass.prototype.unload = function() {
this.recordset.splice(0);
this.currentRecord = 0;
this.loaded = false;
this.recordCount = 0;
if (this.autoMapData == true) {
this.updateMappedFields();
}
delete this.endOfData;
delete this.startOfData;
this.onChanged();
};
fDataSetClass.prototype.mapFields = function(d, f) {
this.temp = new Array();
if(f == undefined){
f = d;
}
this.temp["dataField"] = d;
this.temp["flashField"] = f;
this.mappedFields.pushIt(this.temp);
delete this.temp;
};
fDataSetClass.prototype.clearMappedFields = function() {
this.mappedFields.splice(0);
};
fDataSetClass.prototype.updateMappedFields = function() {
for (i=0; i<this.mappedFields.length; i++) {
curObj = eval(this.mappedFields[i]["flashField"]);
curObj.text = this.recordset[this.currentRecord][this.mappedFields[i]["dataField"]];
}
delete i;
};
fDataSetClass.prototype.nextRecord = function() {
if (this.currentRecord<(this.recordCount-1)) {
this.currentRecord++;
if (this.autoMapData == true) {
this.updateMappedFields();
}
this.bounds();
this.onChanged();
}
};
fDataSetClass.prototype.previousRecord = function() {
if (this.currentRecord>0) {
this.currentRecord--;
if (this.autoMapData == true) {
this.updateMappedFields();
}
this.bounds();
this.onChanged();
}
};
fDataSetClass.prototype.firstRecord = function() {
if (this.currentRecord>0) {
this.currentRecord = 0;
if (this.autoMapData == true) {
this.updateMappedFields();
}
this.bounds();
this.onChanged();
}
};
fDataSetClass.prototype.lastRecord = function() {
realCount = this.recordCount-1;
if (this.currentRecord<(realCount)) {
this.currentRecord = realCount;
if (this.autoMapData == true) {
this.updateMappedFields();
}
this.bounds();
this.onChanged();
}
};
//
fDataSetClass.prototype.setFieldSplitter = function(s) {
this.fieldSplitter = s;
};
fDataSetClass.prototype.getFieldSplitter = function() {
return this.fieldSplitter;
};
fDataSetClass.prototype.setRecordSplitter = function(s) {
this.recordSplitter = s;
};
fDataSetClass.prototype.getRecordSplitter = function() {
return this.recordSplitter;
};
fDataSetClass.prototype.setQuery = function(q) {
this.query = q;
};
fDataSetClass.prototype.getQuery = function() {
return this.query;
};
fDataSetClass.prototype.setChangeHandler = function(f) {
this.changeHandler = f;
};
fDataSetClass.prototype.getChangeHandler = function() {
return this.changeHandler;
};
fDataSetClass.prototype.setErrorHandler = function(f) {
this.errorHandler = f;
};
fDataSetClass.prototype.getErrorHandler = function() {
return this.errorHandler;
};
fDataSetClass.prototype.setAutoMapData = function(f) {
this.autoMapData = f;
};
fDataSetClass.prototype.getAutoMapData = function() {
return this.autoMapData;
};
fDataSetClass.prototype.countRows = function() {
var counter = 0;
for (i=0; i<this.fdsDataRows.length; i++) {
if (this.fdsDataRows.charAt(i) == this.recordSplitter) {
counter++;
}
}
this.recordCount = counter+1;
delete i;
delete counter;
};
fDataSetClass.prototype.onData = function() {
if (this.fdsDataLoaded eq "true") {
if (Number(this.fdsError)>0) {
this.error = this.fdsError;
this.errorText = this.fdsErrorText;
this.onError();
} else {
this.loaded = true;
this.formatData();
}
delete this.fdsDataLoaded;
delete this.fdsError;
delete this.fdsErrorText;
}
};
fDataSetClass.prototype.bounds = function() {
if (this.currentRecord == (this.recordCount-1)) {
this.endOfData = true;
} else {
this.endOfData = false;
}
if (this.currentRecord == (0)) {
this.startOfData = true;
} else {
this.startOfData = false;
}
};
fDataSetClass.prototype.onChanged = function() {
eval(this.changeHandler).call();
};
fDataSetClass.prototype.onError = function() {
eval(this.errorHandler).call();
};
fDataSetClass.prototype.initialize = function() {
this._visible = false;
this.startOfData = false;
this.endOfData = false;
this.recordset = new Array();
this.loaded = false;
this.currentRecord = 0;
this.mappedFields = new Array();
};
fDataSetClass.prototype.formatData = function() {
if (Number(this.fdsCount) == 0) {
this.recordCount = 0;
this.onChanged();
delete this.fdsCount;
return;
}
this.countRows();
this.fdsDataRows = this.fdsDataRows.split(this.recordSplitter);
this.fdsDataFields = this.fdsDataFields.split(this.fieldSplitter);
for (i=0; i<this.recordCount; i++) {
this.fdsDataRows[i] = this.fdsDataRows[i].split(this.fieldSplitter);
var fields = new Array();
for (j=0; j<this.fdsDataRows[i].length; j++) {
currentField = this.fdsDataFields[j];
fields[currentField] = (this.fdsDataRows[i][j]);
}
this.recordset.pushIt(fields);
currentField = null;
}
delete i;
delete currentField;
delete j;
delete fields;
delete this.fdsDataRows;
delete this.fdsDataFields;
delete this.fdsDataLoaded;
delete this.fdsCount;
this.startOfData = true;
if (this.autoMapData == true) {
this.updateMappedFields();
}
this.onChanged();
};
Array.prototype.pushIt = function(e) {
this[this.length] = e;
};
Object.registerClass("fDataSet", fDataSetClass);
#endinitclip
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.