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 5953441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:49:35+00:00 2026-05-22T17:49:35+00:00

I want to create something like a scratch with 3 options. First website sends

  • 0

I want to create something like a scratch with 3 options. First website sends info about which field is correct. then flash replaces 2 movie clips with ‘wrong’ image and 1 with ‘good’ image. I already created scratch evect but in only works on 1 object. I don’t know why?

I even tried duplication of event functions. Best way would be getting index of element. but how to pass it in event function?

Basically its just 3 black tiles with images on them. But why only the first object works?

My code is:

function getFlashVars():Object {
    return Object(LoaderInfo(this.loaderInfo).parameters);
}

var m = 0;

function stopRys(myszka:MouseEvent):void {
    m = myszka.currentTarget.tabIndex;
    cover[m].removeEventListener(MouseEvent.MOUSE_MOVE, tworzMaske);
    image[m].removeEventListener(MouseEvent.MOUSE_MOVE, tworzMaske);
}

function startRys(myszka:MouseEvent):void {
    m = myszka.currentTarget.tabIndex;
    cover[m].addEventListener(MouseEvent.MOUSE_MOVE, tworzMaske);
    image[m].addEventListener(MouseEvent.MOUSE_MOVE, tworzMaske);
}

function tworzMaske(myszka:MouseEvent):void {
    m = myszka.currentTarget.tabIndex;
    image[m].visible = true;
    rysuj[m].graphics.lineStyle(1);
    rysuj[m].graphics.beginFill(0x000000);
    rysuj[m].graphics.drawCircle(mouseX, mouseY, 50);
    image[m].mask = rysuj[m];
}

var key1 = getFlashVars().key1;

var intWidth:Number = 200;
var intHeight:Number = 200;
var cover = new Array();
var image = new Array();
var rysuj = new Array();
var i:Number = 0;

for (i=0; i<3; i++) {
    cover[i] = new MovieClip();
    image[i] = new MovieClip();
    rysuj[i] = new Sprite();

    cover[i]._x = intWidth*i;
    cover[i]._y = 0;
    cover[i].tabIndex = i;
    cover[i]._width = intWidth;
    cover[i]._height = intHeight;
    cover[i].graphics.beginFill(0x000000);
    cover[i].graphics.drawRect(intWidth*i,0,intWidth,intHeight);
    cover[i].graphics.endFill();

    image[i]._x = intWidth*i;
    image[i]._y = 0;
    image[i].tabIndex = i;
    image[i]._width = intWidth;
    image[i]._height = intHeight;
    var myBitmapDataObject:przegrana = new przegrana(200, 200);
    var myImage:Bitmap = new Bitmap(myBitmapDataObject);
    image[i].addChild(myImage);

    addChild(cover[i]);
    addChild(image[i]);
    addChild(rysuj[i]);

    image[i].visible = false;

    image[i].addEventListener(MouseEvent.MOUSE_DOWN, startRys);
    cover[i].addEventListener(MouseEvent.MOUSE_DOWN, startRys);
    image[i].addEventListener(MouseEvent.MOUSE_OUT, stopRys);
    image[i].addEventListener(MouseEvent.MOUSE_UP, stopRys);

}

EDIT:

Now i have some wierd problem. Events work only on first object just like it would be on whole flash movie.

  • 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-22T17:49:36+00:00Added an answer on May 22, 2026 at 5:49 pm

    You “can’t” pass custom arguments to even listeners. To know which object dispatched an event you can use myszka.target.

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

Sidebar

Related Questions

I want to create a unique id but uniqid() is giving something like '492607b0ee414'
In C# if I want to create a Custom Event you do something like
I want to create a number of masked edit extenders from codebehind. Something like:
I want to do something like this: create table app_users ( app_user_id smallint(6) not
I want to do something like: MyObject myObj = GetMyObj(); // Create and fill
If I want to create a .NET object in the powershell I write something
I want to create the following element: <exercises xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="mySchema.xsd"> If I use something
I want something simple in order to experiment/hack. I've created a lot interpreters/compilers for
I want create a drop shadow around the canvas component in flex. Technically speaking
I want to create a Java application bundle for Mac without using Mac. According

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.