Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

change image using action script 3

Explorer ,
Mar 31, 2015 Mar 31, 2015

hi,

my game is built using AS3, No time line code.

I have an image in the stage (frame 1) which acts as the Background

However I cant seem to figure out how to make it, so when it becomes level 2 the background image changes to a different image?

I know its a conditional statement, but I don't know how to switch the images if you understand what I'm saying.

would be something like

if (CurrentLevel ==2)

{

//code

}

TOPICS
ActionScript
750
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Mar 31, 2015 Mar 31, 2015

Are you allowed to use Movieclip symbols?  If so, then you can create a Movieclip (placed in frame 1) that has the different images on different frames and control which frame that Movieclip is on with your code.

Otherwise you will need to look into dealing with the Loader class for your images, where you load them dynamically.

Translate
LEGEND ,
Mar 31, 2015 Mar 31, 2015

How do you intend to change the images... go to a new frame.... or load a new image?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 31, 2015 Mar 31, 2015

I cant use new frames because my game is built with AS3 only, I only use the frame1 of the time line, here this is what i mean

Screenshot by Lightshot

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 31, 2015 Mar 31, 2015
LATEST

Are you allowed to use Movieclip symbols?  If so, then you can create a Movieclip (placed in frame 1) that has the different images on different frames and control which frame that Movieclip is on with your code.

Otherwise you will need to look into dealing with the Loader class for your images, where you load them dynamically.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines