Newgrounds.com — Everything, By Everyone.

Checking login status…

USERNAME:

PASSWORD:

Logging in…

Logged in as:
.
Logging out…
Inbox My Account Log Out


Forum Topic: AS3 Help: timeline functions

(77 views • 4 replies)

This topic is 1 page long.

<< < > >>
None

ShooterMG

Reply To Post Reply & Quote

Posted at: 5/19/07 03:42 PM

ShooterMG EVIL LEVEL 03

Sign-Up: 11/10/06

Posts: 267

Say I have a function on the main timeline called addBullet()

How do I access this from one of my class files?


None

ShooterMG

Reply To Post Reply & Quote

Posted at: 5/19/07 05:21 PM

ShooterMG EVIL LEVEL 03

Sign-Up: 11/10/06

Posts: 267

bump


None

Nuggs

Reply To Post Reply & Quote

Posted at: 5/19/07 05:24 PM

Nuggs LIGHT LEVEL 18

Sign-Up: 12/17/05

Posts: 1,205

Why dont you just add the function as a private function in your class.

Games|1|2|3| Movies|1|2|

BBS Signature

None

ShooterMG

Reply To Post Reply & Quote

Posted at: 5/19/07 05:25 PM

ShooterMG EVIL LEVEL 03

Sign-Up: 11/10/06

Posts: 267

At 5/19/07 05:24 PM, Nuggs wrote: Why dont you just add the function as a private function in your class.

Because I'm working with the display list and other variables on the main timeline, and this would just be more convenient.


None

ShooterMG

Reply To Post Reply & Quote

Posted at: 5/19/07 05:31 PM

ShooterMG EVIL LEVEL 03

Sign-Up: 11/10/06

Posts: 267

Also if it helps explain my situation better, I have an enemy class, and when he shoots I need to instantiate a bullet object. If I had the function as a private function part of the enemy class, I would have to instantiate a bullet inside the enemy class, pass it to the main timeline to add it to the bulletArray, and add it to the display list, then destroy the previously instantiated bullet. This would take up more resources and CPU cycles than if i were to just simply have it all done on the main timeline to begin with.


All times are Eastern Daylight Time (GMT -4) | Current Time: 06:16 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!