Flashkunniga - Actionscript för textscroll fungerar ej Använde mig av följande guide för att skapa en textscroll för Static Text; http://www.webwasp.co.uk/tutorials/...Såvitt jag vet har jag följt instruktionerna till punkt och pricka, men ändå fungerar inte scrollen. Här är en länk till Flash-filen (Flash MX v6.0): http://nimashams.atspace.com/scrollingtext2.fla Och här är publiceringen: http://nimashams.atspace.com/scrollingtext2.html Hoppas någon lyckas lista ut det , vore väldigt tacksam! Tack!
on(press){ play();}
on(release){ stop();}---Med det sagt måste jag säga att det där var det kanske sämsta sätt att bygga en scroll i flash som jag sett, jag kan förklara varför senare.
scroll.btnUp.onPress = function() { scroll.onEnterFrame = function() { if(cont._y<0){ scroll.handle._y-=8; cont._y = ((cont._height-340)*(scroll.handle._y/(scroll._height-scroll.handle._height)))*-1; } } } scroll.btnUp.onRelease = function() { delete scroll.onEnterFrame; } scroll.btnUp.onDragOut = function() { delete scroll.onEnterFrame; } scroll.btnDown.onPress = function() { scroll.onEnterFrame = function() { if(scroll.handle._y<310){ scroll.handle._y+=8; cont._y = ((cont._height-340)*(scroll.handle._y/(scroll._height-scroll.handle._height)))*-1; } } } scroll.btnDown.onRelease = function() { delete scroll.onEnterFrame; } scroll.btnDown.onDragOut = function() { delete scroll.onEnterFrame; }
scroll.handle.onPress = function() { scroll.handle.startDrag(0,0,0,0,scroll._height-scroll.handle._height); scroll.onEnterFrame = function() { cont._y = (((cont._height+20)-340)*(scroll.handle._y/(scroll._height-scroll.handle._height)))*-1; }}
scroll.handle.onRelease = function() { scroll.handle.stopDrag();}
scroll.handle.onReleaseOutside = function() { scroll.handle.stopDrag();}