Jump to content

setting variables in flash using visual basic 6

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
10 replies to this topic

#1
pitchfork_it

pitchfork_it

    Newbie

  • Members
  • Pip
  • 7 posts
hello,

I am creating an application where VB and Flash are interfaced,

I am able to set textboxes in flash from visual basic using the following command

Call flashtest.SetVariable("_root.textbox.text", "lets try this")

but when i try to set a variable in flash using vb, it just dosent work

Call flashtest.SetVariable("_global.t2", "lets try this")

where t2 is my global variable in flash.

Can some one please tell me, how to set these variables in flash using VB

#2
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
I think that, that method only works for variables starting _root

#3
pitchfork_it

pitchfork_it

    Newbie

  • Members
  • Pip
  • 7 posts
i tried that too, but didnt work, how does flash know that vb is sending some data

#4
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
It doesn't know that VB is sending it data lol. Vb just modifies the values, it's like using TSearch to 'hack' games... (if you ever used that)

#5
pitchfork_it

pitchfork_it

    Newbie

  • Members
  • Pip
  • 7 posts
apparently, it did not modify the value, i might be doing something significantly wrong on the flash side, cos from the way you are explaining it, it sounds simple, and i m not that naive of a programmer

#6
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Well i have no idea on how flash programming works, but for sure flash does not know that Vb is sending anything. I mean, you are using the flash control, not actual VB

#7
pitchfork_it

pitchfork_it

    Newbie

  • Members
  • Pip
  • 7 posts
Got it working, thank you for your help :)

#8
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
mind sharing the code/method that you used?

#9
pitchfork_it

pitchfork_it

    Newbie

  • Members
  • Pip
  • 7 posts
The following link has a very good tutorial that shows how it works,

Visual Basic Examples - Tutorial 7

The problem i was trying to solve was, I was in Frame 20 in flash and i needed vb to update the variables over there.

Apparently when you use setvariable function using vb, it updates the variable but it does that in Frame 0,

now both the frames in the movie are at "_root". And all the sites mentioned that vb will update variables only at _root and thats wht confused me, cos both my farme 20 and frame 0 is at _root, then why isnt vb updating the values?

Well as i mentioned above, vb will only update the variable and hold that value at _root. Frame 0 , So if i am in frame 20 and i need to access these values, i need to call a function which is sitting in frame 0 and which will access these variables and then return back to frame 20.

I hope i am making sense

:)

#10
Byapti

Byapti

    Newbie

  • Members
  • Pip
  • 1 posts
Hi,

I think the Flash/VB article on adobe.com/devnet/flash/articles/flash_vb.pdf may be helpful in this discussion.

This popular white paper is written by some engineering folks from our organization Mindfire Solutions (mindfiresolutions.com).

I hope you find it useful!

Cheers,
Byapti

#11
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
It's OK, he got it working. Thanks anyway, and welcome to CodeCall. ;)
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums