Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Releasing Memory

Status
Not open for further replies.

bebbo

Programmer
Dec 5, 2000
621
GB
I've got a problem playing video clips within a shockwave object. These videos play fine at first, until you open another form then close that one. Then sometimes the video plays somtimes it doesn't. The form is cosed down with code like below:

i = _SCREEN.FORMCOUNT
DO WHILE i > 0
DO CASE
CASE ALLTRIM(UPPER(_SCREEN.FORMS(i).NAME)) == "FOOTE2"
oFORMFOOTe2.TIMER1.ENABLED = .T.
i = i - 1
LOOP
CASE ALLTRIM(UPPER(_SCREEN.FORMS(i).NAME)) == "FOOTE1"
i = i - 1
LOOP
OTHERWISE
RELEASE WINDOWS (_SCREEN.FORMS(i).NAME)
i = i - 1
ENDCASE
ENDDO

We then open a form containing the shockwave object. This works fien but if a button is pressed on the shockwave object to play video it crashes with a fatal error.

However if I close the form using thisform.release the video appears to work OK (this is not good enough as upto 50 forms could be open which need closing). Further investigation might suggest memory isn't been released.

I cann't release the shockwave form using code within the form (ie thisform.release) as this creates an error. Therefore I hide the shockwave form then release it using similar code to above.

Has anyone got ideas on releasing the shockwave form or releasing memory or why the video sometimes plays then sometimes doesn't.

Very complicated Problem!!!!! Any help will be appreciated!!!!!
 
I would suggest, instead of:
[tt]
RELEASE WINDOWS (_SCREEN.FORMS(i).NAME)
[/tt]
do this:
[tt]
_SCREEN.FORMS(i).Hide()
_SCREEN.FORMS(i).Release()
[/tt]
This will hide then release each form, which should work with your ShockWave form as well.

Ian
 
Should that work even if the code is within the ExternalEvent procedure of shockwave?? (when clsoing shovewave form down).
 
I honestly can't say for sure since I don't have Shockwave. However, the RELEASE WINDOWS command is not designed to be used with forms. It is for a WINDOW, which I believe is an altogether different type of object.

Don't quote me on this, but that is my understanding.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top