Link to home
Start Free TrialLog in
Avatar of vkani
vkaniFlag for India

asked on

Animation control

Hi friends!
When I try to play some .avi files using vb animation control, an error message like " unable to open avi file " appears.The same file is opened and played by windows media player. Also some other .avi files are played using the same animation control without any trouble.What's wrong with those avi files(or with my animation
 control)?
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

>>unable to open avi file
Check your avi file path, since the error comes where the avi file is not found.

You may post your codes here too.

regards
Avatar of vkani

ASKER

dear ryancys,
when the path of the avi file is wrong, the error message will be 'file not found'.But I got the message as 'unable to open avi file.' I checked the path also & found it correct.
my code:

Private Sub Command1_Click()
   With Animation1
      .AutoPlay = True
      .Open ("d:\program files\microsoft visual studio\common\graphics\videos\fox.avi")
   End With
End Sub
I cant found then animation control you mean, however, you can try use the Windows Media Player Control:

Example:

Private Sub Command1_Click()
    With MediaPlayer1
        .AutoStart = True
        .FileName = "d:\program files\microsoft visual studio\common\graphics\videos\fox.avi"
        .Play
    End With
End Sub

Hope this helps
Avatar of vkani

ASKER

Sorry ryancys!
 It doesn't work! If I use 'mediaplayer1' ,I get 'Object required' error in that line!
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial