Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to stop a function from working until a certain frame

New Here ,
Mar 10, 2013 Mar 10, 2013

Hi

I need to know how to stop a function from happening until I get to a certain frame

I'm using class files

Thanks

TOPICS
ActionScript
3.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 12, 2013 Mar 12, 2013

something doesn't make sense.  what does the following trace() reveal:

in Game.as:

function init(e:Event):void{

_stage=stage;

trace(stage);  //is this line 38?

   Key.initialize(stage);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 12, 2013 Mar 12, 2013

i get this but it will carry on as it keeps saying the same thing when a enemy spawns

[object Stage]

[object Stage]

[object EnemyShip]

[object Stage]

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

at Game/sendEnemy()

at flash.utils::Timer/_timerDispatch()

at flash.utils::Timer/tick()

[object EnemyShip]

[object Stage]

[object Stage]

[object EnemyShip]

[object Stage]

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

at Game/sendEnemy()

at flash.utils::Timer/_timerDispatch()

at flash.utils::Timer/tick()

[object RocketShip]

[object Stage]

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

at Game/sendEnemyRocket()

at flash.utils::Timer/_timerDispatch()

at flash.utils::Timer/tick()

[object EnemyShip]

[object Stage]

[object RocketShip]

[object Stage]

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

at EnemyShip/shoot()

at flash.utils::Timer/_timerDispatch()

at flash.utils::Timer/tick()

[object EnemyShip]

[object Stage]

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

at Ship/move()

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

at Ship/move()

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

at EnemyBullet/enterFrame()

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

at Bullet/enterFrame()

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

at EnemyShip/shoot()

at flash.utils::Timer/_timerDispatch()

at flash.utils::Timer/tick()

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

at Ship/move()

[object EnemyShip]

[object Stage]

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

at Game/sendEnemy()

at flash.utils::Timer/_timerDispatch()

at flash.utils::Timer/tick()

[object EnemyShip]

[object Stage]

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

at Bullet/enterFrame()

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

at Ship/move()

[object RocketShip]

[object Stage]

[object EnemyShip]

[object Stage]

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

at EnemyBullet/enterFrame()

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

at EnemyShip/shoot()

at flash.utils::Timer/_timerDispatch()

at flash.utils::Timer/tick()

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

at EnemyBullet/enterFrame()

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

at RocketShip/shoot()

at flash.utils::Timer/_timerDispatch()

at flash.utils::Timer/tick()

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

at Bullet/enterFrame()

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

at EnemyShip/kill()

at EnemyShip/enterFrame()

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

at EnemyShip/kill()

at EnemyShip/enterFrame()

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

at EnemyShip/shoot()

at flash.utils::Timer/_timerDispatch()

at flash.utils::Timer/tick()

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 12, 2013 Mar 12, 2013

you're reporting inconsistant results which is going to make it impossible to help you via a forum.

no code has changed between the code that triggered a Key.as error and the last example that does not contain a Key.as error.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 13, 2013 Mar 13, 2013

What can I do because this is really annoying

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 13, 2013 Mar 13, 2013

you either need to use the same steps to test your swf so you can report consistant results or hire someone to fix this for you.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 13, 2013 Mar 13, 2013

ok ill try but if that dosent word where would i find someone to hire?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 13, 2013 Mar 13, 2013
LATEST

send me an email:  http://www.kglad.com > contact.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines