for item+i ?
robmoorman - 16/11/2007 18:10
|
PHP interesse |
|
ik heb de volgende As:
item1.item_mask.onRollOver = function() {
var tw:Tween = new Tween(item1.item_bold, "_y", Strong.easeOut, 0, -80, 1, true);
var tw2:Tween = new Tween(item1.item_light, "_y", Strong.easeOut, 80, 300, 1, true);
var tw3:Tween = new Tween(item1.text, "_y", Strong.easeOut, 35, -35, 1, true);
var tw4:Tween = new Tween(item1.text_top, "_y", Strong.easeOut, -35, 65, 1, true);
}
item1.item_mask.onRollOut = function() {
var tw:Tween = new Tween(item1.item_bold, "_y", Strong.easeOut, -80, 0, 1, true);
var tw2:Tween = new Tween(item1.item_light, "_y", Strong.easeOut, 300, 80, 1, true);
var tw3:Tween = new Tween(item1.text, "_y", Strong.easeOut, -35, 35, 1, true);
var tw4:Tween = new Tween(item1.text_top, "_y", Strong.easeOut, 65, -35, 1, true);
}
item1.item_mask.onRollOver = function() { var tw:Tween = new Tween(item1.item_bold, "_y", Strong.easeOut, 0, -80, 1, true); var tw2:Tween = new Tween(item1.item_light, "_y", Strong.easeOut, 80, 300, 1, true); var tw3:Tween = new Tween(item1.text, "_y", Strong.easeOut, 35, -35, 1, true); var tw4:Tween = new Tween(item1.text_top, "_y", Strong.easeOut, -35, 65, 1, true); } item1.item_mask.onRollOut = function() { var tw:Tween = new Tween(item1.item_bold, "_y", Strong.easeOut, -80, 0, 1, true); var tw2:Tween = new Tween(item1.item_light, "_y", Strong.easeOut, 300, 80, 1, true); var tw3:Tween = new Tween(item1.text, "_y", Strong.easeOut, -35, 35, 1, true); var tw4:Tween = new Tween(item1.text_top, "_y", Strong.easeOut, 65, -35, 1, true); }
echter heb ik 8 menuitems... kan ik hier een for lus van maken zodat er steeds item+i (item1 t/m item8) word gedaan ??
ik krijgh et niet voor elkaar
|
3 antwoorden
Gesponsorde links |
|
vinTage - 17/11/2007 09:56
|
Nieuw lid |
|
for(i=0; i<8; i++){
this['item'+i].item_mask.onR......
}
for(i=0; i<8; i++){ this['item'+i].item_mask.onR...... }
|
robmoorman - 17/11/2007 18:03
|
PHP interesse |
|
ok ik heb nu dit:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var totaal:Number = 8;
for(var i = 0; i < totaal; i++)
{
var mc:MovieClip = attachMovie("item","item"+i,i);
mc._x = 100*i;
mc._y = 0;
mc.item_mask.onRollOver = over;
mc.item_mask.onRollOut = out;
}
function over()
{
var tw:Tween = new Tween(this._parent.item_bold, "_y", Strong.easeOut, 0, -120, 1, true);
var tw2:Tween = new Tween(this._parent.item_light, "_y", Strong.easeOut, 80, 300, 1, true);
var tw3:Tween = new Tween(this._parent.text, "_y", Strong.easeOut, 35, -255, 1, true);
var tw4:Tween = new Tween(this._parent.text_top, "_y", Strong.easeOut, -35, 65, 1, true);
}
function out()
{
var tw:Tween = new Tween(this._parent.item_bold, "_y", Strong.easeOut, -120, 0, 1, true);
var tw2:Tween = new Tween(this._parent.item_light, "_y", Strong.easeOut, 300, 80, 1, true);
var tw3:Tween = new Tween(this._parent.text, "_y", Strong.easeOut, -255, 35, 1, true);
var tw4:Tween = new Tween(this._parent.text_top, "_y", Strong.easeOut, 65, 255, 1, true);
}
import mx.transitions.Tween; import mx.transitions.easing.*; var totaal:Number = 8; for(var i = 0; i < totaal; i++) { var mc:MovieClip = attachMovie("item","item"+i,i); mc._x = 100*i; mc._y = 0; mc.item_mask.onRollOver = over; mc.item_mask.onRollOut = out; } function over() { var tw:Tween = new Tween(this._parent.item_bold, "_y", Strong.easeOut, 0, -120, 1, true); var tw2:Tween = new Tween(this._parent.item_light, "_y", Strong.easeOut, 80, 300, 1, true); var tw3:Tween = new Tween(this._parent.text, "_y", Strong.easeOut, 35, -255, 1, true); var tw4:Tween = new Tween(this._parent.text_top, "_y", Strong.easeOut, -35, 65, 1, true); } function out() { var tw:Tween = new Tween(this._parent.item_bold, "_y", Strong.easeOut, -120, 0, 1, true); var tw2:Tween = new Tween(this._parent.item_light, "_y", Strong.easeOut, 300, 80, 1, true); var tw3:Tween = new Tween(this._parent.text, "_y", Strong.easeOut, -255, 35, 1, true); var tw4:Tween = new Tween(this._parent.text_top, "_y", Strong.easeOut, 65, 255, 1, true); }
dit werkt echter nog niet... ik heb in de functie ook een trace gedaan: en die geeft dan weer '_level0.itemx
als die _level0 ervoor wegkan zou hij het moeten doen.... ????? |
vinTage - 17/11/2007 19:15 (laatste wijziging 17/11/2007 19:21)
|
Nieuw lid |
|
En zo iets ?
Als dit het niet is zou een FLA wel handig zijn...beetje moeilijk inschatten wat wat is in dit geval.
for (i=0; i<8; i++) {
var mc:MovieClip = attachMovie("item", "item"+i, i);
mc._x = 100*i;
mc._y = 0;
mc.onRollOver = function() {
var tw:Tween = new Tween(mc.item_bold, "_y", Strong.easeOut, 0, -80, 1, true);
var tw2:Tween = new Tween(mc.item_light, "_y", Strong.easeOut, 80, 300, 1, true);
var tw3:Tween = new Tween(mc.text, "_y", Strong.easeOut, 35, -35, 1, true);
var tw4:Tween = new Tween(mc.text_top, "_y", Strong.easeOut, -35, 65, 1, true);
mc.onRollOut = function() {
var tw:Tween = new Tween(item1.item_bold, "_y", Strong.easeOut, -80, 0, 1, true);
var tw2:Tween = new Tween(item1.item_light, "_y", Strong.easeOut, 300, 80, 1, true);
var tw3:Tween = new Tween(item1.text, "_y", Strong.easeOut, -35, 35, 1, true);
var tw4:Tween = new Tween(item1.text_top, "_y", Strong.easeOut, 65, -35, 1, true);
};
};
}
for (i=0; i<8; i++) { var mc:MovieClip = attachMovie("item", "item"+i, i); mc._x = 100*i; mc._y = 0; mc.onRollOver = function() { var tw:Tween = new Tween(mc.item_bold, "_y", Strong.easeOut, 0, -80, 1, true); var tw2:Tween = new Tween(mc.item_light, "_y", Strong.easeOut, 80, 300, 1, true); var tw3:Tween = new Tween(mc.text, "_y", Strong.easeOut, 35, -35, 1, true); var tw4:Tween = new Tween(mc.text_top, "_y", Strong.easeOut, -35, 65, 1, true); mc.onRollOut = function() { var tw:Tween = new Tween(item1.item_bold, "_y", Strong.easeOut, -80, 0, 1, true); var tw2:Tween = new Tween(item1.item_light, "_y", Strong.easeOut, 300, 80, 1, true); var tw3:Tween = new Tween(item1.text, "_y", Strong.easeOut, -35, 35, 1, true); var tw4:Tween = new Tween(item1.text_top, "_y", Strong.easeOut, 65, -35, 1, true); }; }; }
|
Gesponsorde links |
|
Dit onderwerp is gesloten. |
|