Framing Help

How Do I Do It Like If I Type A 1 The First Image Appears Then When I Type A 2 The Second Image Appears And Replaces The First Image And I Can Switch It And I Can Either Loop It Play It Once Or Single Frame

So switch frames when you press a key?