@@ -1827,7 +1827,9 @@ cc.FadeIn = cc.ActionInterval.extend(/** @lends cc.FadeIn# */{
18271827 * @param {Number } time time in seconds
18281828 */
18291829 update :function ( time ) {
1830- this . _target . setOpacity ( 255 * time ) ;
1830+ if ( this . _target . RGBAProtocol ) {
1831+ this . _target . setOpacity ( 255 * time ) ;
1832+ }
18311833 } ,
18321834
18331835 /**
@@ -1872,7 +1874,9 @@ cc.FadeOut = cc.ActionInterval.extend(/** @lends cc.FadeOut# */{
18721874 * @param {Number } time time in seconds
18731875 */
18741876 update :function ( time ) {
1875- this . _target . setOpacity ( 255 * ( 1 - time ) ) ;
1877+ if ( this . _target . RGBAProtocol ) {
1878+ this . _target . setOpacity ( 255 * ( 1 - time ) ) ;
1879+ }
18761880 } ,
18771881
18781882 /**
@@ -1948,15 +1952,19 @@ cc.FadeTo = cc.ActionInterval.extend(/** @lends cc.FadeTo# */{
19481952 * @param {Number } time time in seconds
19491953 */
19501954 update :function ( time ) {
1951- this . _target . setOpacity ( ( this . _fromOpacity + ( this . _toOpacity - this . _fromOpacity ) * time ) ) ;
1955+ if ( this . _target . RGBAProtocol ) {
1956+ this . _target . setOpacity ( ( this . _fromOpacity + ( this . _toOpacity - this . _fromOpacity ) * time ) ) ;
1957+ }
19521958 } ,
19531959
19541960 /**
19551961 * @param {cc.Sprite } target
19561962 */
19571963 startWithTarget :function ( target ) {
19581964 cc . ActionInterval . prototype . startWithTarget . call ( this , target ) ;
1959- this . _fromOpacity = target . getOpacity ( ) ;
1965+ if ( this . _target . RGBAProtocol ) {
1966+ this . _fromOpacity = target . getOpacity ( ) ;
1967+ }
19601968 }
19611969} ) ;
19621970
@@ -2020,16 +2028,20 @@ cc.TintTo = cc.ActionInterval.extend(/** @lends cc.TintTo# */{
20202028 */
20212029 startWithTarget :function ( target ) {
20222030 cc . ActionInterval . prototype . startWithTarget . call ( this , target ) ;
2023- this . _from = this . _target . getColor ( ) ;
2031+ if ( this . _target . RGBAProtocol ) {
2032+ this . _from = this . _target . getColor ( ) ;
2033+ }
20242034 } ,
20252035
20262036 /**
20272037 * @param {Number } time time in seconds
20282038 */
20292039 update :function ( time ) {
20302040 var locFrom = this . _from , locTo = this . _to ;
2031- this . _target . setColor ( cc . c3b ( locFrom . r + ( locTo . r - locFrom . r ) * time ,
2032- ( locFrom . g + ( locTo . g - locFrom . g ) * time ) , ( locFrom . b + ( locTo . b - locFrom . b ) * time ) ) ) ;
2041+ if ( this . _target . RGBAProtocol ) {
2042+ this . _target . setColor ( cc . c3b ( locFrom . r + ( locTo . r - locFrom . r ) * time ,
2043+ ( locFrom . g + ( locTo . g - locFrom . g ) * time ) , ( locFrom . b + ( locTo . b - locFrom . b ) * time ) ) ) ;
2044+ }
20332045 }
20342046} ) ;
20352047
0 commit comments