SunQuest
           Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 6th, 2004, 01:21 PM
polisheagle polisheagle is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 4 polisheagle User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cannot use array values inside a function

I am trying to use values in an array within a different function than where the array was created.

I created and am attempting to access the array as _global

Is there something special I need to do than I am already doing.

PolishEagle

Last edited by polisheagle : January 6th, 2004 at 09:49 PM.

Reply With Quote
  #2  
Old January 6th, 2004, 02:31 PM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,375 Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)  Folding Points: 6414 Folding Title: Novice Folder
Time spent in forums: 2 Weeks 5 Days 11 h 40 m 11 sec
Reputation Power: 492
Facebook MySpace
Hi, what happens if you create the array outside of both functions?
__________________
-Tann

-Vote for your favorite ActionScript editor here.

Reply With Quote
  #3  
Old January 6th, 2004, 02:49 PM
polisheagle polisheagle is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 4 polisheagle User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
actually upon looking at the code again the array is created ouside of a function, but within a conditional loop.

Reply With Quote
  #4  
Old January 6th, 2004, 03:31 PM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,375 Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)  Folding Points: 6414 Folding Title: Novice Folder
Time spent in forums: 2 Weeks 5 Days 11 h 40 m 11 sec
Reputation Power: 492
Facebook MySpace
Hi, I just tried it out. If you move the _global.myarray outside of everything you can definately access it from functions. Try creating it first and then using it...i.e. get it out of the loop

Reply With Quote
  #5  
Old January 6th, 2004, 03:45 PM
polisheagle polisheagle is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 4 polisheagle User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
return?

when I attempt to place a return outside of the nested conditional statement the values are usable, but unfortunately the rest of the conditionals are not executed.

Is there a way to "return" the values without breaking out of loops?

Reply With Quote
  #6  
Old January 6th, 2004, 04:40 PM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,375 Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Tann San User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)  Folding Points: 6414 Folding Title: Novice Folder
Time spent in forums: 2 Weeks 5 Days 11 h 40 m 11 sec
Reputation Power: 492
Facebook MySpace
Hi, could you show us some code? Makes it a bit easier than guessing... :¬)

Reply With Quote
  #7  
Old January 6th, 2004, 09:48 PM
polisheagle polisheagle is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 4 polisheagle User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Different Angle

I tried it from a different angle...

Instead of using an array:

Code:
_global.stextBuffer[i][n] =


I used a dynamically generated variable name:

Code:
this["stextBuffer2_"+((i*10)+n)]  =


This seemed to be more readily accessable from different parts of my app.

PolishEagle

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Cannot use array values inside a function


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway