Problemer med actionscript compilering af .FLA fil.
Hejsa..Jeg har et problem, som jeg håber nogle kan hjælpe med.
Selv er jeg ikke nogen AS haj (endnu).
Vi har lige (på arbejde) modtaget kildekoden til vores nye web. som er lavet i flash. Tanken var nu, at vi så kunne lave nogle små ændringer selv. - men hver gang jeg skal compilere skidtet, så får jeg disse fejl:
**Error** C:\Documents and Settings\hdl\Desktop\comp\Menu.as: Line 9: This statement is not permitted in a class definition.
_global.Menu.prototype = new MovieClip();
**Error** C:\Documents and Settings\hdl\Desktop\comp\MenuItem.as: Line 17: This statement is not permitted in a class definition.
_global.MenuItem.prototype = new MovieClip();
**Error** C:\Documents and Settings\hdl\Desktop\comp\Menu.as: Line 9: This statement is not permitted in a class definition.
_global.Menu.prototype = new MovieClip();
Noget tyder på at det er i menu.as og menuitem.as der er noget galt. men hvad der er galt - har jeg ingen idé om.
- Nedenfor er koden til de 2 filer. - håber der er en som kan afhjælpe problemet for mig. - er ved at få grå hår :-(
MenuItem.as
----------------
class MenuItem
{
var caption, index;
function MenuItem(text, ind)
{
super();
if (ind !== undefined)
{
this.setIndex(ind);
} // end if
if (text !== undefined)
{
this.setCaption(text);
} // end if
} // End of the function
var _l2 = new MovieClip();
_global.MenuItem.prototype = new MovieClip();
function setCaption(txt)
{
this.caption = txt;
} // End of the function
function setIndex(ind)
{
this.index = ind;
} // End of the function
} // End of Class
Menu.as
----------------------
class Menu
{
var caption, ID, table, parent, items, ref, _x, caption_MC, _alpha, selectCounter, _parent, over;
function Menu()
{
super();
} // End of the function
var _l2 = new MovieClip();
_global.Menu.prototype = new MovieClip();
function setCaption(txt)
{
this.caption = txt;
} // End of the function
function linkTable(ID, tab, parent)
{
this.ID = ID;
this.table = tab;
this.parent = parent;
} // End of the function
function byID(index)
{
var i = 0;
while (i < this.ID.length)
{
if (this.ID[i] == index)
{
return (i);
} // end if
++i;
} // end while
return (undefined);
} // End of the function
function findMaster(index)
{
var i = this.byID(index);
while (this.ID[i] !== this.parent[i] && this.parent[i] !== 0)
{
if (i !== this.byID(this.parent[i]))
{
i = this.byID(this.parent[i]);
continue;
} // end if
i = undefined;
break;
} // end while
return (this.ID[i]);
} // End of the function
function create(menu_location)
{
var m = this.createEmptyMovieClip("MenuHolder", 15000);
this.items = new Array();
var cnt = 0;
var i = 0;
while (i < this.table.length)
{
this.items[i] = undefined;
var mc = m.attachMovie("MenuItem", "MenuItem_" + this.ID[i], this.ID[i]);
mc.subs = new Array();
mc.master = this.findMaster(this.ID[i]);
this.items[i] = mc;
if (this.parent[i] == 0 || this.parent[i] == this.ID[i])
{
mc._x = 0 + cnt * (mc._width + 2);
mc._y = 0;
++cnt;
}
else
{
var s = 0;
while (s < this.ID.length)
{
if (this.ID[s] == this.parent[i])
{
this.items[s].subs.push(mc);
mc._y = 5 + this.items[s].subs.length * 15;
mc.parent = s;
mc._alpha = 0;
mc.highlite_MC._yscale = 60;
mc.onEnterFrame = function ()
{
this._x = this.ref.items[this.parent]._x;
this.caption_MC._alpha = 40;
if (this.parent !== undefined && this.ref.selectedGroup == this.ref.items[this.parent].master)
{
this._alpha = (this._alpha + 100) / 2;
}
else
{
this._alpha = this._alpha / 2;
} // end if
};
break;
} // end if
++s;
} // end while
} // end if
mc.ref = this;
mc.index = this.ID[i];
mc.arrayindex = i;
mc.mother = this.parent[i];
mc.highlite_MC.selectCounter = 0;
mc.highlite_MC._alpha = 0;
mc.setCaption(this.table[i].toUpperCase());
mc.highlite_MC.onEnterFrame = function ()
{
if (this.selectCounter > 0)
{
this._alpha = this.selectCounter % 2 * 100;
--this.selectCounter;
if (this.selectCounter == 0)
{
_global.updateMenu(this._parent.index);
} // end if
}
else if (this.over)
{
this._alpha = (this._alpha + 100) / 2;
}
else
{
this._alpha = (this._alpha + 60) / 2;
} // end if
};
mc.highlite_MC.onRelease = function ()
{
this._parent.ref.current = this;
this.selectCounter = 6;
};
mc.highlite_MC.onRollOver = function ()
{
if (this._parent._alpha > 5)
{
this._parent.ref.selectedGroup = this._parent.master;
this._parent.ref.selectedIndex = this._parent.index;
this._parent.ref.selectedItem = this._parent;
} // end if
this.over = true;
};
mc.highlite_MC.onRollOut = function ()
{
if (this._parent.ref.selectedIndex == this._parent.index)
{
this._parent.ref.selectedGroup = undefined;
this._parent.ref.selectedItem = undefined;
this._parent.ref.selectedIndex = undefined;
} // end if
this.over = false;
};
mc.highlite_MC.onReleaseOutside = function ()
{
if (this._parent.ref.selectedIndex == this._parent.index)
{
this._parent.ref.selectedGroup = undefined;
this._parent.ref.selectedItem = undefined;
this._parent.ref.selectedIndex = undefined;
} // end if
this.over = false;
};
++i;
} // end while
} // End of the function
function MenuItem(text)
{
this.setCaption(text);
} // End of the function
} // End of Class