Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Game Development
  4. Please don't laugh - Flash MX 2004 attachMovie problem

Please don't laugh - Flash MX 2004 attachMovie problem

Scheduled Pinned Locked Moved Game Development
adobedebugginghelplounge
2 Posts 2 Posters 10 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    EvScott
    wrote on last edited by
    #1

    Hi - I know. Don't ask me why! It's all I can afford right now. However, more to the point, I've a problem that is really weird. I'm trying to attach a movie using the following code: //this code is associated with the button: on(press){ _root.attachMovie("MyOldMovieClip", "MyNewMovieClip"+level, level); _root["MyNewMovieClip"]+level._x = int(Math.random() * 500); _root["MyNewMovieClip"]+level._y = int(Math.random() * 450); level++; } I've got a movie clip symbol, and a button symbol in the library. The button only is on the stage. //This code is associated with the stage: level = 0; stop(); Pressing the button produces nothing. However when I run a trace i.e. trace(int(Math.random() * 500)); random values appear. Please put me out of my misery.

    enhzflepE 1 Reply Last reply
    0
    • E EvScott

      Hi - I know. Don't ask me why! It's all I can afford right now. However, more to the point, I've a problem that is really weird. I'm trying to attach a movie using the following code: //this code is associated with the button: on(press){ _root.attachMovie("MyOldMovieClip", "MyNewMovieClip"+level, level); _root["MyNewMovieClip"]+level._x = int(Math.random() * 500); _root["MyNewMovieClip"]+level._y = int(Math.random() * 450); level++; } I've got a movie clip symbol, and a button symbol in the library. The button only is on the stage. //This code is associated with the stage: level = 0; stop(); Pressing the button produces nothing. However when I run a trace i.e. trace(int(Math.random() * 500)); random values appear. Please put me out of my misery.

      enhzflepE Offline
      enhzflepE Offline
      enhzflep
      wrote on last edited by
      #2

      Wow, it's been a while since I used flash, sometime around when ActionScript 3 came in I think. I can't remember anymore - it's just what I've read: Example myButton.onPress = function () { trace ("onPress called"); }; Got it at Adobe, right here[^].

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups