Yeah you played that fairly poorly. First off fold preflop to the guys opening bet. A3s isn't a horrible hand to limp in late position after limpers, but it is fairly often a dominated hand when facing a raise. For instance, if he had a hand such as AJ then you only had 28% to win (because only your 3 card was live). So dump it preflop.

On the flop you don't need to be playing that passively there by just calling a potsized bet. A potsized bet gives you 2:1 pot odds and the chances of catching a flush on the next card is 4:1 so you aren't getting enough. Especially with another guy to act behind you. Easy fold.