Cody Longo -- star of the Nickelodeon show "Hollywood Heights" -- was popped for drunk driving in L.A. this week after cops say he was flashing other drivers ... we're talking lights, not genitals ... sorry.
Law enforcement sources tell TMZ ... 25-year-old Longo -- who's also appeared on "Days of Our Lives" and "Piranha 3D" -- was driving in Hollywood around 2:30 AM Thursday morning when cops noticed him driving like a complete d-bag.
Sources tell us ... Longo was driving aggressively ... following too close to another car and flashing it with his high beams.
Once cops pulled the guy over, we're told officers noticed Longo reeked of booze -- so they performed various field sobriety tests ... which he bombed.
One source tells us ... Longo's blood alcohol level was .19 and .20 ... more than twice the legal limit.
Longo was arrested and hauled to a nearby police station where he was booked ... and later released after posting $15,000 bail.
A rep for Longo tells us, "This was an unfortunate misunderstanding," adding, "Cody takes it very seriously as his focus is music and acting."