Have a function perform a function

In my game I have created a construction where a popup window
calls a predefined function if OK is pressed.
Unfortunately the function I call (bald in the script) is not
performed...
it looks like this:
For a tile in my game I defined the method: klikAction
Next to that I also defined an okAction (to be performed by
the popup when ok is clicked)
Popup function does show the text, but the okAction is not
performed.....
Any suggestions??
here is my script:
game.Tile102.prototype.klikAction = function(){
var action:String = "normal";
var tekst:String = "You pikc up the fax and read";
this.gotoAndStop(16); //show fax-img without the faxpaper
popup(tekst, action, this.okAction);}
game.Tile102.prototype.okAction = function(){
trace("OKACTION!!");
game.gameState.score += 5;
changeScore(game.gameState.score, 100);
game.gameState.isFax = false;
game.gameState.mouse = 2;
_root.mouse.gotoAndStop(2);
function popup(tekst:String, action:String,
okAction:Function){
stopAllMovements();
if(action == "normal"){
var popup:MovieClip = _root.attachMovie("popup_mc", "PopUp",
20000, {_x:(Stage.width-390)/2, _y:(Stage.height-200)/2});
popup.tekst_txt.text = tekst;
//create OK button to perform okActie and close the popup
popup.popup_btn_ok_mc.btnLabel_txt.text = "O.K.";
popup.popup_btn_ok_mc.onRelease = function() {
trace("hiero");
restartAllMovements();
popup.removeMovieClip();
okAction.apply();

Well, maybe It is better explained with a "cleaner" script,
and a debug code in it.
I will show you the script and the oputput in the output
window it generates.
SCRIPT:
game.Tile102.prototype.klikAction = function(){
var tekst:String = "Je pakt de fax en leest";
popup(tekst, this.okAction);
for (var i in this)
trace(i+": "+this
game.Tile102.prototype.okAction = function(){
trace("OKACTION!!");
function popup(tekst:String, okAction:Function){
var popup:MovieClip = _root.attachMovie("popup_mc", "PopUp",
20000, {_x50, _y50});
popup.tekst_txt.text = tekst;
//maak een OK button die de okActie uitvoert en dan de popup
mc sluit.
popup.popup_btn_ok_mc.btnLabel_txt.text = "O.K.";
popup.popup_btn_ok_mc.onRelease = function() {
trace("hiero");
okAction.apply();
popup.removeMovieClip();
OUTPUT::
onRelease: [type Function]
j: 3
i: 1
onEnterFrame: [type Function]
and also the trace "hiero" is reflected in thee output
window.
So, no okAction is found as a property of Tile102.
I am puzzled.... Any suggestions??
game.Tile102.prototype.klikAction = function(){

Similar Messages

  • I have just sought  to update my lightroom and am now unable to access the develop function and get a note stating that I have reduced functionality what it this about and how do I get my product back

    I have just sought  to update my lightroom and am now unable to access the develop function and get a note stating that I have reduced functionality what it this about and how do I get my product back

    Hi there
    I have version 5.7 and every time I opened it I was told that updates are available and to click on the icon to access these.  Instead it just took me to the
    adobe page with nowhere visible to update.  I then  sought to download lightroom cc and this is when I could not access the 'develop' section due to reduced
    functionality  It was apparent that my photos had been put in cc but no way to access them unless I wanted to subscribe. 
    I have since remedied the problem as  my original lightroom 5.7 icon is still available on the desktop and have gone back to that.  I do feel that this is a bit
    of a rip off and an unnecessary waste of my time though.
    Thank you for your prompt reply by the way.
    Carlo
    Message Received: May 04 2015, 04:52 PM
    From: "dj_paige" <[email protected]>
    To: "Carlo Bragagnolo" <[email protected]>
    Cc:
    Subject:  I have just sought  to update my lightroom and am now unable to access the develop function and get a note stating that I have
    reduced functionality what it this about and how do I get my product back
    dj_paige  created the discussion
    "I have just sought  to update my lightroom and am now unable to access the develop function and get a note stating that I have reduced functionality what it
    this about and how do I get my product back"
    To view the discussion, visit: https://forums.adobe.com/message/7510559#7510559
    >

  • I cannot turn on my notes in icloud without signing up for a new account.  I already have a functioning account, but just want to turn on another function.  What do I do?

    I already have a functioning icloud account that syncs my information from my iphone to my PC.  I don't want to start a new account, but it seems that Apple is forcing me to open a new account to merely turn on a new function, which is my notes.  Any way to turn this on without having to sign up for a new account?  I have too many accounts already to keep up with. I don't need Apple forcing me into another one.  Any help is appreciated.
    Chad

    I have the same problem. My apple account uses my yahoo address,which works fine. But when I try to turn on notes in my iPad's iCloud settings, iPad tells me I need a me.com email address, giving me only two c hoices: create or cancel .... Then when I try to create a me.com email address, iPad tells me it has already been created ... What to do?

  • Is there a way to create albums on iPad 2 without connecting to a computer? I heard the iPad 1 did that? It's rather stupid that they don't have that function built in.

    Is there a way to create albums on iPad 2 without connecting to a computer? I heard the iPad 1 did that? It's rather stupid that they don't have that function built in.

    If you are referring to photo albums no you can't create them on the iPad with the current iOS software. You could not do it on the iPad original either as stated above.
    You can purchase third party apps that allow you to do so. One app that I know of is called Photo-Sort. I am sure there are others available in the app store if you care to search.
    You can provide feedback to Apple here and let them know how you feel.
    http://www.apple.com/feedback/ipad.html

  • My iPhone 4s no longer displays photos or text in horizontal mode. Is there a reset option or a known way to have this functionality return?

    My iPhone 4s no longer displays photos or text in horizontal mode. Is there a reset option or a known way to have this functionality return?

    RRGarcia wrote:
    My iPhone 4s no longer displays photos or text in horizontal mode. ...
    It could be this... Orientation Lock
    Settings > General > Lock Rotation..
    Or...
    Double-press the home button...
    Swipe to the right until you get to the Portrait Orientation Button...

  • Can't have aggregate function in WHERE clause clause

    Dear all,
    I've created object in BO XI 3.1 Designer with following criterias:
    http://img4.imageshack.us/img4/833/20111201124314.th.jpg
    It is a simple number - 1,2,3,4,5.
    Now I need to use this object as a criteria for WHERE function in another object.
    http://img607.imageshack.us/img607/1543/20111201124717.th.jpg
    I receive an error "Can't have aggregate function in WHERE clause <clause>"
    How can I overcome this?
    P.S. I'm sorry in advance if such topic already exist - I didn't found one.
    Edited by: Ashot Antonyan on Dec 1, 2011 9:50 AM
    Edited by: Ashot Antonyan on Dec 1, 2011 9:51 AM

    Hi,
    You will have to use Sub query to achieve this. Give more details on what is available and what you need then i could help you out with the complete solution.
    Thanks,
    Ravichandra K

  • Ipad 2 screen is black . when i press the power button it takes a screen shot but i have no functionality . tried holding the home and power button together but the screen just flicker and stay black . no apple icon shows up. help please

    ipad 2 screen is black . when i press the power button it takes a screen shot but i have no functionality . tried holding the home and power button together but the screen just flicker and stay black . no apple icon shows up. help please

    Make sure it is charged for about 10min using the adapter, then connect in recovery mode, explained in this article:
    If you can't update or restore your iOS device

  • HT2832 Help!  My fire wire  400 ports have stopped functioning, and my 800 is now having problems

    Help!  My fire wire  400 ports have stopped functioning, and my 800 is now having problems....I'm getting a protools message telling me there is a problem with my firewire.

    First, you have posted in the wrong area, this is for PPCs and you have an intel.
    Try repairing permissions and resetting the PRAM.
    Let us know how you made out.

  • Does DPS have GPS functionality? If not do they plan to add it and when?

    Does DPS have GPS functionality? If not do they plan to add it and when?

    Here is the sdk.. https://developers.google.com/maps/. Or do a search on stackoverflow.com and people have some examples of how to use it.

  • Have filter function in iOS' numbers? Any one can teach me?

    Hi, any one know in iOS' number have filter function? I really no idea about this. Who can teach me?
    Thanks....

    You can read the online Numbers guide here: http://help.apple.com/numbers/ipad/2.2/

  • I have transefer function like (1/(s^2+s+​5)) and i have a square wave input , i want to use this transfer function with this input to see the output , how can i do that , with example please.

    i need to know also how to represent this transfer function in labview, try to send me example. answer me at my mail

    "st" wrote:
    > answer me at my mail
    give a valid e-mail first, and your name, we don't like to help anonymous
    people
    > try to send me example.
    how much do you pay ?
    > i have transefer function like (1/(s^2+s+5)) and i have a square wave
    > input , i want to use this transfer function with this input to see
    > the output , how can i do that
    First you have to know what you are doing, like an engineer : you have a
    Laplace, continuous time transfer function but LabView handles discrete
    signals only. Use matlab/simulink if you want to simulate continuous time
    systems easily...
    If you definitely want to use LabView, the first step is to discretize your
    continuous-time transfer function, i.e. decide a sampling rate and convert
    it to a "z transfor
    m". Then you can directly use the "IIR Filter.vi" as I
    said earlier.
    Philippe Guglielmetti - www.dynabits.com me at my mail

  • For some reason the function keys on my mac book changed, I restored them and now the shift keys have the function of showing the desktop and all windows.  I there a way I can restore the original function?

    For some reason the function keys on my mac book changed, I restored them and now the shift keys have the function of showing the desktop and all windows.
    I there a way I can restore the original function?

    You do not tell us what OS version you have. In OS 10.8.2, do this:
    Apple Menu / System Preferences / Language and Text / Input Sources.
    Select the language you want. Mine is set to Canadian English.

  • Does discoverer plus 9.2 have the function of Email?

    Hi,
    Does discoverer plus 9.2 have the function of Email?
    If the answer is NO,how can I send and email by discoverer ?
    Thanks.

    Justin:
    Good guess.
    Absolutely nothing fancy here.
    Connected to:
    Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
    With the Partitioning option
    JServer Release 8.1.7.4.0 - Production
    SQL> CREATE FUNCTION foo (p_a IN VARCHAR2) RETURN NUMBER;
      2  /
    Warning: Function created with compilation errors.
    SQL> show error
    Errors for FUNCTION FOO:
    LINE/COL ERROR
    0/0      PLS-00378: invalid compilation unit for this release of PL/SQLIf you just want a stub function for now, then you need to do something more like:
    SQL> CREATE OR REPLACE FUNCTION foo (p_a IN VARCHAR2) RETURN NUMBER AS
      2  BEGIN
      3     RETURN 1;
      4  END;
      5  /
    Function created.HTH
    John

  • Does Unlocked iPhone 4S Have Full Functionality ?

    If I purchase anFactory Unlocked iPhone 4S, will it have full functionality (i.e. Siri, iTunes, FaceTime, Apps) even if I do not activate it with a cell carrier?

    Yes. You will have to connect it to a WiFi network to get all the Data Functions.

  • Does final cut express have the functionality like macromedia flash 8?

    does final cut express have the functionality like macromedia flash 8? I'm looking to compile my movie for easy viewing on the internet

    In the interest of not appearing like a total idiot
    The link of my 3-minute video of Native American Indian dancing (above) has been changed to: http://www.goliveusa.com/MoviesFlv/PowWow.html
    where it should remain for at least the next two years.
    Part of this change has to do with a discontent with .Mac, thought that is certainly a topic for another forum.
    Since back here at this thread, and considering the initial forum topic, I'd guess it would be appropriate to ask: "What is meant by the term: functionality?"
    FCE is a a video editing program. Flash 8 is graphic animation program.
    You can incorporate video into Flash 8 and do extra animation with it.
    PowerPC G5 Duel 2.3   Mac OS X (10.4.5)   4.5GB RAM; 2HD's; CS2/FCE/Studio8/Maya7/Optura500/GoLiveUSA.com

  • Have "ZOOM" function in the map???Please help me~~

    in my project , in need write a map of a building.
    i would like to use zoom fucntion to let user to look into the room number in the box instead of room
    do the j2me have this function and how to implement ??
    please help
    urgent event~~~thz a lot

    in my project , in need write a map of a building.
    Sounds like you are working with graphics, not collections
    i would like to use zoom fucntion to let user to look
    into the room number in the box instead of room
    Yeah, sounds like you need to be posting in the Java2D forums
    do the j2me have this function and how to implement
    I'm sure there are 2D graphics calls you can make in J2ME. You basically need to get the subimage or subsection of the original image, then scale it to the size of the canvas and redraw.

Maybe you are looking for

  • HT4759 After updating I can no longer see iTunes or iBooks, what do I do to see them again?

    After updating iOS, now I can't see the iTunes app or iBooks.  The buttons are still there, but when you click on it, it comes up blank.  How do I get it back?

  • Running a batch file on ftp server

    HI All, i am trying to use Command line facility of file adapter to run a batch file.. i batch file i have a single command as mkdir ranjeet. how should i call this batch file from file adapter.. i tried putting batch file name in the command line se

  • How to zip all the files generated using file adapter

    Hello Everyone, I have a scenario in place where i split a message into multiple messages. I used to generate multiple file using the file name present in the payload of the splitted message using variable substitution. This is working fine. Now the

  • Send Fax using rfax

    Hi I am sending a fax using rfax but i can not understand how can i set the size of page. I am using html format to send data. please help me if anybody has knowledge of rfax.

  • Replication between diferent platforms

    Hi everybody, has somebody answer me a very important and urgent question? Is it possible to replicate dabases between SUN and HP, with oracle data guard, or what is the procedure to do this. thanks in advance, is very impórtan to me.