Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7619825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:47:14+00:00 2026-05-31T03:47:14+00:00

I’ve got two Actionscript files linked with one .fla file. The file Document.as is

  • 0

I’ve got two Actionscript files linked with one .fla file. The file Document.as is suppose to support the keyboard controls and the mouse controls, whilst the Reset.as is suppose to control the reset of the card (this is an interactive birthday card). I’ve added this on the ‘Reset.as’ file, however, when the “reset” button is pressed, nothing happens! None of the images move away, or anything! Am I doing something wrong here? All the files have been given instance names!

Here is the ‘Reset.as’ code;

    package src
    {

import flash.events.*;
import flash.display.*;

    public class Reset extends MovieClip 
    {       

        public function Reset ()
    {

        mouse();
    }

    public function mouse()
    {
        reset.addEventListener(MouseEvent.CLICK, Reset1);
    }

    public function Reset1(e:MouseEvent) :void 

        {
            aldo.x = -176.80;
            aldo.y = 282;

            aldoo.x = -322.80;
            aldoo.y = 286;

            reset.x = -401.75;
            reset.y = 328.45;

            firework1.x = 100.75;
            firework1.y = 545.15;

            firework.x = 457.55;
            firework.y = 551;

            instruction.x = 437.25;
            instruction.y = 379;

            fade2.x = 132.15;
            fade2.y = 433.15
        }
    }
      }

      //and here's the 'Document.as' code;


   package src
   {
import flash.events.*;
import flash.display.*;

public class Document extends MovieClip
{
    var speed:int = 20;
    var fader:Number = 0.1

    public function Document ()
    {
        init();

    }

    public function init()
    {
        button1.addEventListener(MouseEvent.CLICK, onMouseClick);           
        stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
    }

    public function onMouseClick(e:MouseEvent) :void
    {   
        //if cake is clicked, the y axis for instance "instruction", "firework1", "firework" changes                                        
        instruction.y = 500;
        firework1.y = 100;
        firework.y = 100;

        //if cake is clicked, the y axis for instance "fade2" changes                                   
        fade2.y = 240;      

    }

    public function onKeyDown(e:KeyboardEvent):void
    {
    //if the right key (arrow key) is pressed, 
    //the instances "aldo and "aldoo" move positively on the x axis by "5"
    //the instance "fade2" (which is "Press and hold the right key") also fades out
    //the longer the right arrow key is pressed
    if (e.keyCode == 39 && alpha > 0  )
        {
            aldo.x += speed;
            aldoo.x += speed;
            reset.x += speed;
            fade2.alpha -= fader;
        }

    //if the left key (arrow key) is pressed, 
    //the instances "aldo and "aldoo" move negatively on the x axis by "5"
        if (e.keyCode == 37 )
        {
            aldo.x -= speed;
            aldoo.x -= speed;
            reset.x -= speed;

        }



  }
  }
  }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T03:47:16+00:00Added an answer on May 31, 2026 at 3:47 am

    I’ve got two Actionscript files linked with one .fla file. The file Document.as is suppose to support the keyboard controls and the mouse controls, whilst the Reset.as is suppose to control the reset of the card (this is an interactive birthday card). I’ve added this on the ‘Reset.as’ file, however, when the “reset” button is pressed, nothing happens! None of the images move away, or anything! Am I doing something wrong here? All the files have been given instance names!

    I haven’t used FlashCS5 but I’m sure it hasn’t changed much from CS4.
    There could be a couple of things you missed.
    1)
    You have to make sure that your Document file is linked properly to your .fla file.
    If it isn’t linked correctly, the Flash IDE will give you a message of the sort.
    “A definition for the document class could not be found in the classpath, so one will be automatically generated in the SWF file upon export”

    The Flash project needs to know where to find your Document.as.
    Go to File > Publish Settings
    In the Flash tab, there should be an area that says “Script:” and besides it there should be a “settings” button. Hit the settings button.
    In the following popup menu you should see a tab called “Source Path” here added the directory path to where your document file is located on your computer.

    2)
    Make sure you named the instance of your reset object in your .fla. The way to reference it in your code is to make sure you applied a name to the instance that is one the display tree. You click on the object an in the properties section you can rename it.

    If these two things are done, you will be able to properly register the button click event to you reset button.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
Specifically, suppose I start with the string string =hello \'i am \' me And
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.