Skip to main content
Inspiring
May 31, 2017
Answered

Buttons targeting one movie clip from another

  • May 31, 2017
  • 1 reply
  • 512 views

Hi,

I currently have a button on the main timeline which targets an object in a movieclip.

This is what I have currently:

import fl.transitions.Tween;

import fl.transitions.easing.*;

btn1.addEventListener(MouseEvent.CLICK, ten);

function ten(e: MouseEvent) {

  new Tween(cat1_mc.circle1, "scaleX", Strong.easeOut, 0.0, 0.1, 2, true)

  new Tween(cat1_mc.circle1, "scaleY", Strong.easeOut, 0.0, 0.1, 2, true);

}

But now that button is in another movie clip called "controls_mc" - not on the main timeline.

What would be the path from the button in "controls_mc" to "cat1_mc.circle1 " ???

I've tried numerous recommendations but no result yet!!


Thanks

    This topic has been closed for replies.
    Correct answer Colin Holgate

    If cat1_mc and controls_mc are at the same level, you would get from within controls_mc to cat1_mc.circle1 like this:

    MovieClip(parent).cat1_mc.circle1

    1 reply

    Colin Holgate
    Colin HolgateCorrect answer
    Inspiring
    May 31, 2017

    If cat1_mc and controls_mc are at the same level, you would get from within controls_mc to cat1_mc.circle1 like this:

    MovieClip(parent).cat1_mc.circle1

    Inspiring
    May 31, 2017

    That's great thanks. It works perfect.

    However . . .  I've started getting this error message when I test the movie.

    Are the two things related?

    Inspiring
    May 31, 2017

    this error message sorry:

    [SWF] reviewbuttons.swf - 17321 bytes after decompression

    TypeError: Error #1009: Cannot access a property or method of a null object reference.

      at reviewbuttons_fla::MainTimeline/frame1()[reviewbuttons_fla.MainTimeline::frame1:6]

      at runtime::ContentPlayer/loadInitialContent()

      at runtime::ContentPlayer/playRawContent()

      at runtime::ContentPlayer/playContent()

      at runtime::AppRunner/run()

      at ADLAppEntry/run()

      at global/runtime::ADLEntry()

    [UnloadSWF] reviewbuttons.swf

    Test Movie terminated.