Announcement

Collapse
No announcement yet.

Is it possible to assign onClick script when using Page.CreateObject?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is it possible to assign onClick script when using Page.CreateObject?

    Hello,

    I'm creating objects programatically, and I have the properties table all setup. But I was wondering if I could somehow assign the objects a script to run onClick?

    Thanks for any help!
    -Stobe

  • #2
    Ok I figured out half of what I need to do with Page.SetObjectScript. But now I'm having trouble with regards to the object name.

    I'm creating several images with the Page.CreateObject, and assigning them random names. When I click them, I want to delete them. So I tried creating a script that included Page.DeleteObject, but by the time I click on it, the randomly created object name has moved onto another image.

    Is there a way to delete the object that I'm currently clicking on (like a Page.DeleteObject (self) type function)?

    I tried the GetFocus thing, but focus doesn't work on images.

    Thanks!

    Comment


    • #3
      for the object name you can use the work this, not 'this' or "this" but this on it's own, it should turn blue like true, false, if else and so on.

      so Page.DeleteObject(this) not Page.DeleteObject("this")
      Plugins or Sources MokoX
      BunnyHop 2021 Here

      Comment


      • #4
        That's awesome! Thanks for the help. Its amazing that I've been using this software for so many years with never knowing that, lol

        Comment

        Working...
        X