Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 29-09-2006, 07:07   #1 (permalink)
Neuer User
 
Registriert seit: Dec 2003
Ort: Göttingen
Beiträge: 43
Hilfe bei yugopop menu und AS2

Guten Morgen,

ich habe ein Problem mit einem Menu. Ich nutze das yugopop menu (http://laco.wz.cz/tween/?page=examples) und versuche es fleissig meinen bedürfnissen anzupassen.

leider gibt das script einen fehler aus, wenn ich auf AS 2 schalte (bei AS 1 funzt Zeile 122!) (benötige das für flash player 8). es gibt einen fehler in zeile 122 (**Fehler** Symbol=Ymenu, Ebene=actions, Bild=1:Zeile 120: Typdiskrepanz.
grow_mc.bg_mc._width += parseInt((maxWidth-grow_mc.bg_mc._width)/easingSpeed)

Vielleicht kann mich da jemand aufklären, der weiß was AS 2 daran auszusetzen hat.
vielen dank!!!
benni

Zitat:
_global.printf = function() {
str = "";
for (var i = 0; i<arguments.length; i++) {
str += arguments[i]+", ";
}
trace(str);
};
function init() {
space = 3;
easingSpeed = 3;
minWidth = 20;
maxWidth = 170;
// waiting delay to start resizing
selectedItem = 0;
// item nad ktorym bola naposledy mys, ak je roll out tak ho vynuluje na clickedItem
clickedItem = 3;
// last clicked item
growingItem = null;
reducingItem = null;
// selectedItem after growTime frames
growDelay = 5;
// frames
growTime = 0;
//
// visual settings
items_arr = [];
this.createEmptyMovieClip("updater_mc",-2).onEnterFrame = update;
// ----------------
textanimTime = 0;
textanimDuration = 15;
this.createEmptyMovieClip("textanim_mc",-1)
}
function addItem(label, data) {
var i = items_arr.length;
if (i == 0) {
data.id = 0;
data.mc = item0_mc;
data.smalltext = label;
items_arr.push(data);
} else {
data.id = i;
data.mc = item0_mc.duplicateMovieClip("item"+i+"_mc", i);
data.smalltext = label;
items_arr.push(data);
}
data.mc.id = i;
data.mc.label = label;
data.mc._x = i*(minWidth+space);
//
totalWidth = ((items_arr.length-1)*minWidth)+maxWidth+(items_arr.length-1)*space;
}
function startTextAnimation(oldId,newId){
//duration = 20
//printf("//",newId,items_arr[newId].smallText);
items_arr[oldId].mc.label = items_arr[oldId].smallText
//items_arr[newId].mc.label = items_arr[newId].smallText +":"+ items_arr[newId].text
var strlen = items_arr[newId].text.length
textanim_mc.onEnterFrame = function(){
var rndstr = "";
//
if ((textanimDuration - textanimTime) < strlen){
rndstr += items_arr[newId].text.substr(0, strlen - (textanimDuration - textanimTime))
for (var i = 0; i<(textanimDuration - textanimTime); i++){
rndstr+= String.fromCharCode(random(50) + 20)
}

} else {
for (var i = 0; i<strlen; i++){
rndstr+= String.fromCharCode(random(50) + 20)
}
}
items_arr[newId].mc.label = items_arr[newId].smallText +":"+ rndstr
//
if (textanimTime++ > textanimDuration){
items_arr[newId].mc.label = items_arr[newId].smallText +":"+ items_arr[newId].text
textanimTime = 0
delete this.onEnterFrame
}
}


}

function selectItem(itemId) {
growTime = 0;
selectedItem = itemId;
//
totalWidth = maxWidth+(items_arr.length)*(minWidth+space)-space;
}
function deselectItem(itemId) {
growTime = 0;
selectedItem = clickedItem;

}
function clickItem(itemId){
clickedItem = itemId;
trace(clickedItem);
if(clickedItem == 0) { _root.MainMC.gotoAndPlay(1); }
if(clickedItem == 1) { _root.MainMC.gotoAndPlay(5); }
if(clickedItem == 2) { _root.MainMC.gotoAndPlay(10); }
if(clickedItem == 3) { _root.MainMC.gotoAndPlay(15); }
}

function update() {
// trace(growTime+"//"+growingItem+"//"+selectedItem);
// printf ("gi si ci",growingItem, selectedItem,clickedItem)
if (growTime++ == growDelay && growingItem != selectedItem ) {
//
textanimTime = 0
startTextAnimation( growingItem,selectedItem) ;
//
reducingItem = growingItem;

growingItem = selectedItem;

}
var grow_mc = items_arr[growingItem].mc;
var reducing_mc = items_arr[reducingItem].mc;
//
grow_mc.bg_mc._width += parseInt((maxWidth-grow_mc.bg_mc._width)/easingSpeed);
var restWidth = totalWidth-grow_mc.bg_mc._width-(items_arr.length-1)*(space+minWidth);
reducing_mc.bg_mc._width = restWidth;
var sumWidth = 0;
//printf(restWidth, reducing_mc, grow_mc);
for (var i = 0; i<items_arr.length; i++) {
var item = items_arr[i].mc;
item._x = sumWidth;
sumWidth += item.bg_mc._width+space;
}

}
init();

Geändert von mamboben (29-09-2006 um 07:29 Uhr)
mamboben ist offline   Mit Zitat antworten
Alt 16-02-2009, 16:13   #2 (permalink)
Neuer User
 
Benutzerbild von annabellsche
 
Registriert seit: Mar 2006
Beiträge: 48
Hattest Du evtl. die Lösung gefunden?
__________________
annalog.eu

fscommand ("NIE AUFGEBEN!")
annabellsche ist offline   Mit Zitat antworten
Alt 16-02-2009, 16:41   #3 (permalink)
Neuer User
 
Benutzerbild von annabellsche
 
Registriert seit: Mar 2006
Beiträge: 48
Smile

YEP!
Habs rausgefunden!

HTML-Code:
grow_mc.bg_mc._width += Math.round((maxWidth-grow_mc.bg_mc._width)/easingSpeed);
Selbst ist das annabellsche
__________________
annalog.eu

fscommand ("NIE AUFGEBEN!")
annabellsche ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an



Alle Zeitangaben in WEZ +1. Es ist jetzt 15:23 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele