Results 1 to 10 of 10

Thread: Can't load flash controls at runtime?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2007
    Posts
    22

    Can't load flash controls at runtime?

    Hey guys, long time no see.
    I have searched everywhere on the internet and I couldn't find an answer.
    The problem is at school due the threat of viruses you can't add components.
    So instead I have to reference them and load them at runtime.
    I can get it working for most things but I am having problems with the flash control.

    This is my code:
    Code:
    Dim flash As ShockwaveFlash
    Call Controls.Add("ShockwaveFlash.ShockwaveFlash.10", "flash")
    Set flash = CreateObject("ShockwaveFlash.ShockwaveFlash.10")
    This returns with a type mismatch.
    So then I try:
    Code:
    Dim flash As ShockwaveFlashObjects.FlashProp
    Call Controls.Add("ShockwaveFlash.ShockwaveFlash.10", "flash")
    Set flash = CreateObject("ShockwaveFlash.ShockwaveFlash.10")
    But then I can't use the "LoadMovie" function.
    I am left really confused...
    Any ideas anyone?

  2. #2

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Dec 2007
    Posts
    22

    Re: Can't load flash controls at runtime?

    Yeah, that's how I do it with other controls.
    But I think I have the wrong name in the line:
    Code:
    Controls.Add("ShockwaveFlash.ShockwaveFlash.10", "flash")
    Because it returns a "ShockwaveObjects.FlashProp" which isn't want I'm wanting.
    Also the only Flash control that allows WithEvents is "ShockwaveObjects.Shockwave"
    Now do you see my problem?

    Note: I got the name "ShockwaveFlash.ShockwaveFlash.10" from regedit.

  4. #4

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Dec 2007
    Posts
    22

    Re: Can't load flash controls at runtime?

    I need to load them at runtime.
    I can't load them at design time.
    If I try to add new components, VB crashes.
    So I can't use the Load() function.
    Any more ideas?

  6. #6
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Can't load flash controls at runtime?

    Quote Originally Posted by Osimonbinladen
    I need to load them at runtime.
    I can't load them at design time.
    If I try to add new components, VB crashes.
    So I can't use the Load() function.
    Any more ideas?
    What post #3 describes is a method for adding them at runtime. I've attached a demo.
    Attached Files Attached Files

  7. #7
    Addicted Member
    Join Date
    Apr 2008
    Posts
    198

    Re: Can't load flash controls at runtime?

    you have already load the opject so y u try to load it again?
    ydont u work with operator
    for example (i)
    and load the shockwave(i) using "FOR"
    IT CTO & System Administrator.

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Dec 2007
    Posts
    22

    Re: Can't load flash controls at runtime?

    I can't load them at design time.
    Ok, now as I said earlier the Load() function doesn't work for me.
    I can't initially have one on the form, I need to do everything at runtime.
    Here is an example from another application I made:
    Code:
    Dim WithEvents wsSend As Winsock
    
    Private Sub Form_Load()
        Set wsSend = New Winsock
        wsSend.Protocol = sckUDPProtocol
        wsSend.LocalPort = 1233
        wsSend.RemoteHost = "255.255.255.255"
        wsSend.RemotePort = 1234
        wsSend.Bind
    End Sub
    See what I am aiming for now?
    In stead of adding them as components I add them as a reference.
    Has anybody done this before?

  9. #9
    New Member
    Join Date
    Dec 2012
    Posts
    1

    Re: Can't load flash controls at runtime?

    try AxShockwaveFlashObjects.AxShockwaveFlash. It always works.

    Cheers,

  10. #10
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: Can't load flash controls at runtime?

    Code:
    Private flash As Object
    
    Private Sub Form_Load()
    Set flash = Me.Controls.Add("ShockwaveFlash.ShockwaveFlash.10", "flash")
    'or
    'Set flash = CreateObject("AxShockwaveFlashObjects.AxShockwaveFlash")
    End Sub
    Cannot test i am not on pc right now

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width