I guess we need a little more information - how long do you have for this trip? Do you want to take in other national parks along the way? Do you need full hookup parks or will dry camping be o.k.?
The most direct route from Flagstaff, AZ to East Glacier is Hwy 89 North to Panguitch, Utah (could take in Bryce Canyon Nat'l Park) then west on Hwy 20 ti I-15.
Take I-15 north toward Butte, Montana. You could take in Grand Teton Nat'l Park and Yellowstone Nat'l Park.
I-15 to Hwy 287 at Wolf Creek, Montana to East Glacier.
That would be 1200 miles without any side trips - 4 days @300 mi./day which is good for RVs. Of course, there are many scenic ways to go rather than the interstate...depends on your time and what kinds of things you want to see/do.