Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[AS3] Noobish question

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
GoblinMaster
Advanced Cheater
Reputation: 0

Joined: 05 Jul 2007
Posts: 79

PostPosted: Wed Aug 19, 2009 3:59 pm    Post subject: [AS3] Noobish question Reply with quote

So I was rambling around on Flash and got an idea to try and change the value of an variable using an input text box for both the variable name and value (like an universal trainer), I didn't have any hopes completing this task as I am aware about my skill level but I stumbled upon a question which I hoped someone would help me with.

When entering in test as a variable it somehow seems to work on the three non determined text boxes, however it does not affect the determined value. My question is really as simple as why is it like this?

Code:
Code:

knapp.addEventListener(MouseEvent.CLICK, trykk)
knapp2.addEventListener(MouseEvent.CLICK, trykkigjen)
var test = 100;
var test2 = (visvar.text);
testvar.text = (test);
asdasd.text = test2;


function trykk($e:MouseEvent):void
{
   var varnavn = varverdi.text;
   visvar.text = varnavn;
}
function trykkigjen($e:MouseEvent):void
{
   var test2 = 10;
}


And URL to the flash in question (ugly as hell but design wasn't ecactly on my mind at this foolishness):
Code:

htt p://ww w.zshare.n et/flash/643612865e598cc2/

Black button is 'knapp' and the red button 'knapp2', also why doesn't 'knapp2' affect 'test2'?

Anyway thank you if you even bother to look at this, and excuse my horrible formulation I am pretty sleepy right now.[/code]
Back to top
View user's profile Send private message
Chaosis13
Master Cheater
Reputation: 0

Joined: 14 Aug 2007
Posts: 372

PostPosted: Wed Aug 19, 2009 5:20 pm    Post subject: Reply with quote

If you cleaned up the code, especially renamed things, people might be more willing to help.

I didn't try to understand this, but you did create variable test2 twice.


Here is a link to his project.
Back to top
View user's profile Send private message
Polynomial
Grandmaster Cheater
Reputation: 5

Joined: 17 Feb 2008
Posts: 524
Location: Inside the Intel CET shadow stack

PostPosted: Thu Aug 20, 2009 4:32 am    Post subject: Reply with quote

Change var test2 = 10; to test2 = 10; in trykkigjen.

You're redeclaring the test2 variable in the local scope, so it doesn't affect the global scope variable.

_________________
It's not fun unless every exploit mitigation is enabled.
Please do not reply to my posts with LLM-generated slop; I consider it to be an insult to my time.
Back to top
View user's profile Send private message
GoblinMaster
Advanced Cheater
Reputation: 0

Joined: 05 Jul 2007
Posts: 79

PostPosted: Thu Aug 20, 2009 5:09 am    Post subject: Reply with quote

Burningmace wrote:
Change var test2 = 10; to test2 = 10; in trykkigjen.

You're redeclaring the test2 variable in the local scope, so it doesn't affect the global scope variable.


I see, however removing the var really doesn't change things, asdasd.text still won't accept that test2 is 10.
Back to top
View user's profile Send private message
Polynomial
Grandmaster Cheater
Reputation: 5

Joined: 17 Feb 2008
Posts: 524
Location: Inside the Intel CET shadow stack

PostPosted: Thu Aug 20, 2009 5:15 am    Post subject: Reply with quote

Well you're not actually doing anything with test2 - you set it and that's it. What are you tring to do?
_________________
It's not fun unless every exploit mitigation is enabled.
Please do not reply to my posts with LLM-generated slop; I consider it to be an insult to my time.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites