| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Nov 2004
Location: London
Posts: 9
|
Hi,
I'm having a little trouble with setting a variable via a getter and setter. Basically I want to store a reference to my current selection, so that I can reset it to a previous state later in the code But for some reason my lastSelection is always returning undefined Could someone explain what is going on and how I could fix it please? Thanks. ActionScript Code:
|
|
|
|
|
|
#2 |
|
Registered User
Join Date: Nov 2004
Location: London
Posts: 9
|
Hi,
I have discovered something, which seems to be causing the issue. I am calling a function in my JSFL file from my WindowSWF on a setInterval and it appears that the JSFL is being reloaded(?) with each event. In effect it isn't storing my references because they are being wiped. in my WindowSWF Fla ActionScript Code:
in my JSFL ActionScript Code:
and it seems to trace ActionScript Code:
So, my problem doesn't actually appear to be the getter/setter anymore. It seems that the setInterval is the culprit. However, this now seems to leave me with a new issue. How can I perform a setInterval, with out the JSFl reloading? or How can I store a reference to my current selection? (I imagine I'll have to pass currentFrame, currentLayer, elements* data back and forth between the SWF and the JSFL) (*if the last option is what I have to do, how can I find out the elements index?) Thanks |
|
|
|
|
|
|
|
|
#3 |
|
lala
Join Date: Feb 2002
Location: on the road
Posts: 2,859
|
yes, jsfl does not store the reference, with each call it gets reloaded. u can pass the strings identifying the selection around, but i would imagine it could get nasty. there are some other issues with setinterval from a windowswf and the selection object as well,
read this: http://johan.plasmapudding.com/index.php?id=208 |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|