Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Desktop, Mobile and non-browser Environments > Projectors and CDs

Reply
 
Thread Tools Rate Thread Display Modes
Old 06-05-2002, 03:29 PM   #1
jrutis
Registered User
 
Join Date: Nov 2001
Posts: 12
Unhappy Memory leak?

I have a function that sets correct position, changes colors and plays a sound when a button is dragged and dropped. It works great in test mode but when I try to use it by double-clicking the .swf file or in a .html it doesn't work at all.

If I put in traces it works partially.

If I was working in C I'd think it was a memory leak.

What should I look for?

John
jrutis is offline   Reply With Quote
Old 06-05-2002, 04:19 PM   #2
Ricod
(@_@) -("pretty lights")
 
Ricod's Avatar
 
Join Date: Sep 2001
Location: the Netherlands
Posts: 3,988
Default

I never heard of memory leakage with actionscript

It's probably sumthing silly. R u perhaps loading in data or sumthing ? Its hard to tell from here u know.

If u trace the used data, where does it go wrong ?
__________________
RicoD
Link ?
Ricod is offline   Reply With Quote
Old 06-05-2002, 06:14 PM   #3
jrutis
Registered User
 
Join Date: Nov 2001
Posts: 12
Default

Thanks for the reply!

I didn't think it was really a memory leak. It's just that when you have on in C it acts something like this is acting.

Traces don't help me when I'm not in test mode and it works fine in test mode. It drops in the right spot changes color and makes the sound.

When I try to run it for reals it won't even drag and drop. If I put traces in, even though I can't see the results, it drags and drops but in the wrong place and doesn't change color or make the sound.

I could put up the function but I thought maybe the symptoms were familiar to someone and it was just something dumb I'm doing.

John
jrutis is offline   Reply With Quote
Old 06-05-2002, 07:14 PM   #4
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
Default

add this to one of your frames:
ActionScript Code:
// simple alert / userful to show vars outside of flash / debugging / Movieclip.prototype.alert = function(s){     getURL('javascript:alert("'+s+'")'); }

then replace your trace() actions with
ActionScript Code:
//on _root, or from inside a mc this.alert("put message in here"); //or this.alert(myVar2Trace);

you will get a messagebox popup with the var/message.
__________________
tg
---
what the hell was i thinking?
tg is offline   Reply With Quote
Old 06-06-2002, 06:38 AM   #5
pixelwit
village halfwit
 
pixelwit's Avatar
 
Join Date: Jul 2001
Location: USA, PA
Posts: 3,187
Default

That's pretty sweet TG.

Now I know how to trace a message in the browser window using Javascript. I think that may be handy at some point in time.

Thanks,

-PiXELWiT
http://www.pixelwit.com
__________________
There are no answers, only choices.
pixelwit is offline   Reply With Quote
Old 06-06-2002, 12:45 PM   #6
Ricod
(@_@) -("pretty lights")
 
Ricod's Avatar
 
Join Date: Sep 2001
Location: the Netherlands
Posts: 3,988
Default

Or, if you're not using html / java u could put an extra layer on top of the rest of your swf, put a dynamic textbox in and send the variables there.
__________________
RicoD
Link ?
Ricod is offline   Reply With Quote
Old 06-06-2002, 03:08 PM   #7
jrutis
Registered User
 
Join Date: Nov 2001
Posts: 12
Default

Thanks for the help!

I'll try it as soon as I can - but...

I created the most simplified version I could and the "on (release)" will only do the "stopdrag" and nothing else. If I comment out the stopdrag it does nothing (that is - it doesn't stop dragging). This is only in the normal execution modes; in the test mode it does everything it's supposed to. I've even duplicated the function's innards as just lines within the "on (release)".

I find this bizarre since I have other applications where I do the same kinds of things and they work just great in both test and execution modes.

John
jrutis is offline   Reply With Quote
Old 06-07-2002, 10:58 AM   #8
Ricod
(@_@) -("pretty lights")
 
Ricod's Avatar
 
Join Date: Sep 2001
Location: the Netherlands
Posts: 3,988
Default

Why don't u copy paste the code here ? (use code brackets around them plz ... and disable smilies)

Maybe its umthing silly which you've missed cuz you've been staring at the same piece of code for a day or so (I know I usually miss stuff after being toasted)
__________________
RicoD
Link ?
Ricod is offline   Reply With Quote
Old 06-07-2002, 04:05 PM   #9
jrutis
Registered User
 
Join Date: Nov 2001
Posts: 12
Default

Hi!

The little "alert" function works in test mode but not in normal or html mode.

I just discovered it works fine on Explorer.

Here are the facts:

It works correctly in test mode (CTRL-S).

It doesn't work in normal Flash player mode.

It doesn't work in html in Navigator.

It works correctly in html in Explorer.

When I say it doesn't work I mean stopdrag always works but no other action I've tried ever works.

This is true whether I put the actions in a function and call it or if I put the actions directly in the "on(release)".

Here's my simple attempt:

on(release, releaseOutside) {
stopdrag();
C = new Color("/Testbox");
C.setRGB(0xFF0000);
setProperty("/Testbox", _x, 100);
setProperty("/Testbox", _y, 100);
}

The Testbox is blue to start and at 200,200.

It doesn't move to 100, 100 or change color in normal or Navigator. It does in test or Explorer.

As I said, I've done other applications with very similar function and have had no trouble.

Thanks again!

John
jrutis is offline   Reply With Quote
Old 06-07-2002, 04:17 PM   #10
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,048
Default

hmm... the alert box works for me all the time in ie4.x+, netscape 4.x+, opera.
i use it all the time.

won't work in a projector file tho... uses javascript.
__________________
tg
---
what the hell was i thinking?
tg 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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
24/7 Memory Leak badlorry Other Flash General Questions 6 02-17-2005 02:47 PM
Local XML object remains in memory. michaelbirch ActionScript 2.0 3 09-24-2004 07:57 PM
FLASH BUG (memory leak - LoadVariables) MaKe ActionScript 1.0 (and below) 3 04-19-2004 06:48 PM
setInterval and memory leak jsignal ActionScript 1.0 (and below) 4 10-29-2003 04:38 PM
FMprojector memory leak dancarlson Flashants Support Forum 1 02-12-2003 03:44 PM


All times are GMT. The time now is 04:01 AM.


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