Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 11-09-2003, 10:38 AM   #1
elfis
Registered User
 
Join Date: Oct 2002
Location: Riga, Latvia
Posts: 156
Default vars from function

Hi !! I am kinda confused about this - cant exchange the var in function and back ..
ActionScript Code:
var someVar:Number = 1 this.onEnterFrame = function() {     someVar = 3 }; trace(someVar);//traces "1" ..

so .. how to get "3" to be traced ??!?
tnx !!
elfis is offline   Reply With Quote
Old 11-09-2003, 11:28 AM   #2
senocular
six eyes
 
senocular's Avatar
 
Join Date: Jan 2003
Location: San Francisco, CA (USA)
Posts: 7,875
Send a message via ICQ to senocular Send a message via AIM to senocular Send a message via MSN to senocular Send a message via Yahoo to senocular
Default

the onEnterFrame would have to be run first.

ActionScript Code:
var someVar:Number = 1 this.onEnterFrame = function() {         someVar = 3 }; this.onEnterFrame(); trace(someVar);//traces "3"

either that or wait a frame (where its called automaically) THEN check someVar's value.
__________________
(6)
senocular is offline   Reply With Quote
Old 11-09-2003, 11:38 AM   #3
elfis
Registered User
 
Join Date: Oct 2002
Location: Riga, Latvia
Posts: 156
Default

hey thanks a lot !!! you saved a lot of headaches to me ..
cheers
elfis is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:27 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.