Volledige versie bekijken : [Flash CS3] ActionScript 1.0 & 2.0 Buttons
devendra
%Europe/Berlin %610 %2008, 15:38
Ik ben het ineens kwijt..
Vroeger (toen het nog geen Adobe was) kon ik een actie aan een button hangen..
on(Release) GoToAndStop(.)
Nu probeer ik hetzelfde trukje maar krijg steeds het volgende naar m`n hoofd..
Current selection cannot have actions opplied to it..
Wel vreemd deed het voorheen altijd op die manier?..
Iemand een oplossing?.
Jan
%Europe/Berlin %612 %2008, 15:42
Als je een nieuw document opent moet je kiezen voor AS2 ipv AS3 en dan kan je terug op die oude slechte manier scripten. :P
In AS2 werk je trouwens beter met instance names voor je knoppen en dan zet je het script in een leeg frame op de hoofdtijdlijn ipv zo'n script OP je object. ;)
knop.onRelease=function()
{
gotoAndPlay(2);
}
//ipv script OP je button of MovieClip te zetten wat je eigenlijk nooit hoort te doen
on(release)
{
gotoAndPlay(2);
}
Waarom het een slechte manier van scripten is: 8D
Attaching Code to Objects
You must avoid attaching ActionScript code to objects (such as button or movie clip instances) in a FLA file, even in simple or prototype applications. Attaching code to an object means that you select a movie clip, component, or button instance, open the ActionScript editor (the Actions panel or Script window), and add ActionScript code by using the on() or onClipEvent() handler functions.
This practice is strongly discouraged for the following reasons:
* ActionScript code that is attached to objects is difficult to locate, and the FLA files are difficult to edit.
* ActionScript code that is attached to objects is difficult to debug.
* ActionScript code that is written on a timeline or in classes is more elegant and easier to build upon.
* ActionScript code that is attached to objects encourages poor coding style.
* ActionScript code that is attached to objects forces students and readers to learn additional syntax as well as different coding styles that are often poor and limited.
* Users typically have to relearn how to write functions and so on, on a timeline at a later date.
Lees meer over best practices in AS2 hier:
http://www.adobe.com/devnet/flash/articles/as_bestpractices_04.html
Groeten,
http://users.telenet.be/jansurf/cwo.pngJan
devendra
%Europe/Berlin %789 %2008, 19:57
Top bedankt..
light
%Europe/Berlin %695 %2008, 16:41
Kun je ook met adobe een AS3 bestand omzetten in een AS2 of 1?
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.