Ask a Question related to Macromedia Flash, Design and Development.
-
Roald Fernandez #1
Help: "256 levels of recursion were exceeded in one action list."
I'm trying to make this very simple mathematical flash-program that
factorizes a number. So far i have succeded, but flash dosent allow the
program loop more than 256 times is seems. I get this message:
"256 levels of recursion were exceeded in one action list.
This is probably an infinite loop.
Further execution of actions has been disabled in this movie."
Is there some way I can avoid this, or work my way around somehow?.
************************
The Actionscripting is as such:
var divident:Number = 2;
var tallToFactor:Number;
var tallToFactorOrig:Number;
var toFinish:Number;
var numbercount:Number = 0;
function fact():Void {
if (tallToFactorOrig == toFinish){
return;
}
else {
if (tallToFactor/divident == Math.floor (tallToFactor/divident)) {
trace (divident);
tallToFactor = tallToFactor/divident;
if (numbercount == 0) {
toFinish = divident;
numbercount++;
}
else {
toFinish *= divident;
}
fact();
}
else {
if (divident == 2) {
divident++;
fact();
}
else {
divident += 2;
fact();
}
}}}
mcButton.onPress = function():Void {
divident = 2;
tallToFactor = tNumberType.text; //tNumberType is a input textfield where
the number to factorize is typed
tallToFactorOrig = tNumberType.text;
fact();
}
**************************
Roald Fernandez Guest
-
cfqueryparam ignores null="yes" when list="yes"
I get an unexpected result when using cfqueryparam with list="yes" and null="yes" using CF 7.0.1 and MSSQL 2000. When i run this code: <cfset... -
CFMX7's numerous "request has exceeded the allowabletime limit Tag" bomboffs
Prior to CFMX, you could bump up the RequestTimout on the URL, example: mypage.cfm?RequestTimeout=120. Under CFMX (6.1) you could do it with cfset... -
Form processing: change the "action=" based on pull down menu
Hi group - I have an html form for that uses username and password to login to a specific area of the website. The "area" the user wants to go to... -
Using "Levels" and "Curves" tools for alpha channel
Well, the topic says it all. This is one of the three Photoshop flaws that made me evaluate other programs, and I haven't figured out how to do it in... -
"Start" "Program" "Menu" list is empty
For what ever reason my list of installed programs in my "Start" "Programs" menu is empty. Anyone know how to restore the list. Thanks for your... -
Roald Fernandez #2
Re: "256 levels of recursion were exceeded in one action list."
Given the code, the acion-scripting only allows numbers that have prime
numbers up to 503. Wich makes sence regarding the 256 times loop-limit,
since the program tests numbers with the increment of 2.
Id much appreciate if anyone knows some whay to get around the loop-limit.
Im very familiar with actionscript so, please, any help would be great.
Roald Fernandez Guest
-
Roald Fernandez #3
Re: "256 levels of recursion were exceeded in one action list."
Typo there...
I'm not very familiar with actionscripting
:))
Roald Fernandez Guest
-
Artful #4
Re: "256 levels of recursion were exceeded in one action list."
that's tail end recursion, so you should be able to rewrite your function as
a loop (instead of being recursive).
Artful Guest
-
Der Zählmeister #5
Re: Help: "256 levels of recursion were exceeded in one action list."
ahhhhh! ... mathematics ... my favorite ...
have you tried to write a NON-RECURSIVE version of the fact():Void
function? a non-recursive version would most probably be using 'do'
or 'while' or 'for' loop of some sort.
-----
The Count, Singapore
Learning Objects (e-Learning) Specialist
Roald Fernandez wrote:
> I'm trying to make this very simple mathematical flash-program that
> factorizes a number. So far i have succeded, but flash dosent allow the
> program loop more than 256 times is seems. I get this message:
>
> "256 levels of recursion were exceeded in one action list.
> This is probably an infinite loop.
> Further execution of actions has been disabled in this movie."
>
> Is there some way I can avoid this, or work my way around somehow?.
>
>
> ************************
> The Actionscripting is as such:
>
> var divident:Number = 2;
> var tallToFactor:Number;
> var tallToFactorOrig:Number;
> var toFinish:Number;
> var numbercount:Number = 0;
>
> function fact():Void {
> if (tallToFactorOrig == toFinish){
> return;
> }
> else {
> if (tallToFactor/divident == Math.floor (tallToFactor/divident)) {
> trace (divident);
> tallToFactor = tallToFactor/divident;
> if (numbercount == 0) {
> toFinish = divident;
> numbercount++;
> }
> else {
> toFinish *= divident;
> }
> fact();
> }
> else {
> if (divident == 2) {
> divident++;
> fact();
>
> }
> else {
> divident += 2;
> fact();
>
> }
> }}}
>
> mcButton.onPress = function():Void {
> divident = 2;
> tallToFactor = tNumberType.text; //tNumberType is a input textfield where
> the number to factorize is typed
> tallToFactorOrig = tNumberType.text;
> fact();
> }
> **************************
>
>Der Zählmeister Guest



Reply With Quote

