Skip to main content
ALazyNovelist
Participant
October 4, 2015
Question

Code Snippets are in the Timeline, but Fail to Work

  • October 4, 2015
  • 1 reply
  • 601 views

I'm fairly new to Flash Professional and Actionscript; thus, forgive me if I sound ignorant on certain things.

I'm trying to create a simple movie file in Flash, and I wanted to do transitions between certain pictures. I found out code snippets are a thing, and I did everything I was told to in the Lynda.com tutorial (as I'm using that to teach me what to do). I clicked on my image, went to the Code Snippets bar, put in "Horizontal Transition," and it showed up in my timeline. Even so, the code snippet did nothing. I had the picture activated so it knew to move that particular picture, I had the instance name in the code so it knew which file I wanted to move, I had the default 100 for how many pixels I wanted to move it...I did everything it told me to, and yet the image still stays in the same place. What am I doing wrong?

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
October 4, 2015

Show the code you are using and indicate which object in that code is failing to perform as expected.

ALazyNovelist
Participant
October 5, 2015

Alright; here they are.

I wanted to take this picture and move it horizontally (highlighted in the code snippets bar), so it would expose the right half of the picture and slowly expose the left half.

I even made it a movie clip and added an instance name so I'm able to attach the code.

So I have this, and the code automatically attaches the code for the object to Actions. Maybe this is the problem and I'm overlooking it? Now that I think about it, possibly. Anyway, I've clicked on the item, made it so it would move over to the right by 100 pixels. Same name, no typos, everything is perfect.

Even so, I click play to test it out, and it refuses to work. The picture just stays in place.

robdillon
Participating Frequently
October 5, 2015

The way that you have attached that code to the timeline will cause that code to execute as soon as the movie begins to run. That means that the object named "shesleep" will move right at the start and so you won't see the action. If the object is showing in the default location when the movie runs then there is likely something else going wrong. Do you get an error when you test this movie?