TORONTO - The star-studded cast of "The Secret Life of Bees" say they couldn't help but be inspired by U.S. democratic presidential nominee Barack Obama as they worked on their racially charged period film, set in North Carolina shortly after the landmark U.S. Civil Rights Act of 1964.

Queen Latifah, who portrays a caring beekeeper that takes a neglected white child under her wing, noted that Obama was campaigning in North Carolina while they were shooting the movie.

"I don't know if I thought, 'Hey, we're going to change the world while we're doing this movie,' but the world was changing while we were doing this movie," Latifah told a press conference held at a downtown hotel.

"To be in North Carolina, shoot in this place and film this movie with this multicultural crew and then to watch not very long after... this guy win the state of North Carolina only spoke to me that the people that I'm working with everyday are ready for some change, too."

"The Secret Life of Bees" is based on the bestselling novel by Sue Monk Kidd. It tells the story of a neglected white child, played by Dakota Fanning, who finds refuge with a trio of black sisters, played by Latifah, Sophie Okonedo and Alicia Keys.

Jennifer Hudson portrays a nanny who is beaten and arrested while trying to register to vote.

The film debuted at the Toronto International Film Festival on Friday night with a glitzy red carpet gala that had fans lining the street for a glimpse of the stars.

The film's director, Gina Prince-Blythwood, said she has been awed by the fact that for the first time in history, a black man is in the running to become president of the United States.

"One of the coolest things that people have said about this film is that it could help get Obama elected," said Prince-Blythwood, eliciting applause from some observers at the press conference.

"In that time (of the story) people were saying, 'I may have a chance to vote but probably not in my lifetime.'

"Now, 2008 when we were shooting, I would say even a year ago, some of us would say, 'One day there will be a black president but not in our lifetime.' And suddenly this is happening, so it's just a great way to tie everything together."

Actor Nate Parker said he hoped anyone who sees the film notes the hard-fought determination it took to champion equality in the '60s.

"This is the type of determination we need right now," said Parker. "We can talk about Obama, we can talk about how great a time this is but if we don't make our trek to the voting polls then it's all for nothing."

"Secret Life of Bees" comes out Oct. 17.