Jump to content
Search Community

Strange problem! Please help me!

Dzsurnik test
Moderator Tag

Recommended Posts

Hello! I have a strange problem and I do not at all resolved. The code is very simple. When you test the flash movie, there is no error, everything is working normally, but when I test it in the browser in offline mode, the following error came to me:

 

TypeError: Error #1009: Cannot access a property or method of a null object reference.

at _17_fla::MainTimeline/frame2()

 

and when I hit continue...:

 

TypeError: Error #1009: Cannot access a property or method of a null object reference.

at com.greensock::TweenLite/init()

at com.greensock::TweenLite/renderTime()

at com.greensock.core::SimpleTimeline/renderTime()

at com.greensock::TweenLite$/updateAll()

 

 

my code is here:

stop();
import com.greensock.*;
import com.greensock.easing.*;



TweenLite.to(mc_logo, 1, {x:193.80, y:76.1, ease:Back.easeOut});
TweenLite.to(mc_label, 1, {x:666.5, y:163.05, ease:Back.easeOut});
TweenLite.to(mc_im_csaba, 2, {x:289.15, y:248.30, ease:Back.easeOut});
TweenLite.to(mc_since, 2, {x:400, y:425.85, ease:Back.easeOut});
TweenLite.to(mc_bal_also_linkek, 1, {x:208, y:979.10, ease:Back.easeOut});
TweenLite.to(mc_jobb_also_linkek, 1, {x:724.85, y:979.10, ease:Back.easeOut});
TweenLite.to(mc_images, 2, {x:21, y:795.25, ease:Back.easeOut});
TweenLite.to(mc_flash, 2, {x:21, y:610.2, ease:Back.easeOut});
TweenLite.to(mc_arrow, 2, {x:64.25, y:795.25});
var gyorsasag = 1;//tartalom sebessege


//--------------------------------------------------------
//LOGO BUTTON
//--------------------------------------------------------
mc_logo.addEventListener(MouseEvent.CLICK,  logo_click);
// if you want a hand cursor
mc_logo.buttonMode = true;
mc_logo.useHandCursor = true;



function logo_click(e:MouseEvent)
{
var url_logo:String = "my URL";
var request:URLRequest = new URLRequest(url_logo);
navigateToURL(request, '_blank');
}


//--------------------------------------------------------
//FLASH BUTTON
//--------------------------------------------------------
mc_flash.addEventListener(MouseEvent.ROLL_OVER, flash_over);
mc_flash.addEventListener(MouseEvent.ROLL_OUT, flash_rollout);
mc_flash.addEventListener(MouseEvent.CLICK,  flash_click);
mc_flash.addEventListener(MouseEvent.MOUSE_DOWN, flash_down);
mc_flash.addEventListener(MouseEvent.MOUSE_UP, flash_up);
function flash_over(e:MouseEvent)
{
trace("Over");
}
function flash_rollout(e:MouseEvent)
{
trace("Out");
}
function flash_click(e:MouseEvent)
{
TweenLite.to(mc_slideshows, gyorsasag, {x:-439.5, y:747.5, ease:Back.easeOut});
TweenLite.to(mc_arrow, gyorsasag, {x:64.25, y:610.2, ease:Back.easeOut});

}
function flash_down(e:MouseEvent)
{
trace("Press");
}
function flash_up(e:MouseEvent)
{
trace("Release");
}



//--------------------------------------------------------
//IMAGES BUTTON
//--------------------------------------------------------
mc_images.addEventListener(MouseEvent.ROLL_OVER, images_over);
mc_images.addEventListener(MouseEvent.ROLL_OUT, images_rollout);
mc_images.addEventListener(MouseEvent.CLICK,  images_click);
mc_images.addEventListener(MouseEvent.MOUSE_DOWN, images_down);
mc_images.addEventListener(MouseEvent.MOUSE_UP, images_up);
function images_over(e:MouseEvent)
{
trace("Over");
}
function images_rollout(e:MouseEvent)
{
trace("Out");
}
function images_click(e:MouseEvent)
{
TweenLite.to(mc_slideshows, gyorsasag, {x:400, y:747.5, ease:Back.easeOut});
TweenLite.to(mc_arrow, gyorsasag, {x:64.25, y:795.25, ease:Back.easeOut});

}
function images_down(e:MouseEvent)
{
trace("Press");
}
function images_up(e:MouseEvent)
{
trace("Release");
}

//-----------------------
// BUTTON DEVIANTART
//-----------------------
bt_deviantart.addEventListener(MouseEvent.CLICK,  bt_deviantart_click);
function bt_deviantart_click(e:MouseEvent)
{
var url_deviantart:String = "my URL";
var request:URLRequest = new URLRequest(url_deviantart);
navigateToURL(request, '_blank');
}
//-----------------------
// BUTTON FACEBOOK
//-----------------------
bt_facebook.addEventListener(MouseEvent.CLICK,  bt_facebook_click);
function bt_facebook_click(e:MouseEvent)
{
var url_facebook:String = "my URL";
var request:URLRequest = new URLRequest(url_facebook);
navigateToURL(request, '_blank');
}//-----------------------
// BUTTON 99designs
//-----------------------
bt_99designs.addEventListener(MouseEvent.CLICK,  bt_99designs_click);
function bt_99designs_click(e:MouseEvent)
{
var url_99designs:String = "my URL";
var request:URLRequest = new URLRequest(url_99designs);
navigateToURL(request, '_blank');
}
//-----------------------
// BUTTON Email
//-----------------------
bt_email.addEventListener(MouseEvent.CLICK, mailto);
function mailto(event:MouseEvent):void
{
var email:URLRequest = new URLRequest("mailto:my mail");
navigateToURL(email, '_blank');
}

 

Many thanks for any help!

Link to comment
Share on other sites

Of course you can use TweenLite on buttons. You can use it on ANY object. The errors you're getting indicate that you're trying to tween a null object (nothing) which of course you can't tween. For example, if mc_slideshows is null (doesn't point to a valid object), you'll get an error if you try tweening it.

Link to comment
Share on other sites

I don't see you defining your buttons anywhere.

 

I haven't coded in Flash Professional in a long while, so the following might be incorrect.

 

That being said, I believed you needed to set a variable in the actionscript window so that you would have a pointed to the object that was added to the screen.

 

For example:

stop();
import com.greensock.*;
import com.greensock.easing.*;

var mc_logo:Button;
var mc_label:Label;

...

TweenLite.to(mc_logo, 1, {x:193.80, y:76.1, ease:Back.easeOut});
TweenLite.to(mc_label, 1, {x:666.5, y:163.05, ease:Back.easeOut});

...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...