Hey everyone. I was wondering. There's this variable I can access fine with VB6 by going SF.GetVariable("_level10.objGem.multiple")
but when I use javascript it returns null. _level10.objGem returns [object Object] but then when i add multiple it returns null.
And I was also wondering see how there is a _level10 I have no clue why it is _level10 I would expect a _root or a _global. If its _level10 maybe should i try _level10[1-100]? Whats the limit on levels? what else can be in this spot?
Thanks so much
tomandjerry
your question is rather muddled. VB6 is rather dated, and I believe modern visual basic is almost a different language, however visual basic has lots of legacy that polutes the language, so you are better working with c sharp. More specifically I suggest you look at XAML WPF and C sharp, you can can download visual studio express and autumn blend for free and orcas 2008 trial, and there is plenty of tutorials online.
As for communication between flash, you should be using the ExternalInterface, here is a link using them both http://thewpfblog.com/?p=29 I have struggled to embed flash in WPF using the flash OCX, I think there is some issue with the OCX wrapper not in the current version of orcas or express, it should be sortable I just have not made time, but you can run flash within a browser component given some html wrapping.
Levels are not often used in flash, but you can have lots, it is probably limited by some 256 related multiple, I think that these issues regarding level maybe solved by using the ExternalInterface class.
Since nobody here is really using VB with flash recently you probably won't get much response.
Thanks JLM for the reply. I use JavaScript now rather then vb6 so but JavaScript is giving me problems vb6 did not. So I was trying to fix that. I agree VB6 is quite dated. I search a lot on Google and all of them suggest ExternalInterface, I'm having a hard time figuring that one out. But I'll keep looking into it. Until then I have a temporary solution but it can't be incorporated into my program, do you have MSN or a chat messenger I can work with you live on, i think you might be able to resolve the issue or point me in the direction with the ExternalInterface.
Thanks
You can't address variables like that with javascript. You need ot use the external interface or the JS integration kit. I recommend the kit.
I have been doing some research, so sorry if the info wonders slightly from your requirements, this is always been an area of interest.
javascript integration kit, is easy to find lots onhttp://weblogs.macromedia.com/cantrell/archives/2005/06/flash_js_integr.cfm
For more modern approach than vb6..
Local web server Cassini 2 possibly suitable for XP and Vista that you can embed a local resource inhttp://weblogs.asp.net/britchie/archive/2005/07/25/420512.aspx or varientshttp://www.codeproject.com/aspnet/xNetServer.asp?df=100&forumid=170907&exp=0&select=1128953
If your targeting OSX or Linux then you could look at the mono implementation of dot net and the standalone XSP web server.http://weblogs.asp.net/britchie/archive/2005/07/25/420512.aspx
Another approaches is to use reflection to get com or dll interface info translate it into data that can be transmitted back and forth as CLR and can be addressed with the dot com managed code.http://p2p.wrox.com/topic.asp?TOPIC_ID=36790 reflections seems like clever stuff.
Ofcourse there are other solutions where you can communicate with 3rd party wrappers that are either wrapped ocx or cut down browsers:
SwishStudio allows you to communicate with your own dll's (the forum has some explaination) and for basic stuff it is cheap and easy to use. http://www.swishzone.com/index.php?area=products&product=studio&tab=updates
Zinc has wrapped up external interface to make it easy so you don't notice it? and is fairly cross platform I wrote something to help me.http://www.mdmforum.com/forum/index.php?showtopic=17823&st=0&#entry82767 but things have prob moved on.
Also there is mProjector, swf studio,flash studio etc... I tried mProjector but zinc seemed better to me?http://www.flashjester.com/?section=whatsup Then there is Adobe's air, but it does not seem ideal for distribution?
Then you could go and look at a haxe and the HX screenweaver http://haxe.org/swhx screenweaver has fans, I think the original was commercial then they opensourced it?
Then there is cut down browsers that work with languages such as python which probably are not that light for instance http://patrick.wagstrom.net/tutorials/pygtkmozembed/pygtkmozembed.html
Delphi a friend uses with flash embeded and I think it is now cross platform although you may need some third party stuff to make it easy.
and you can do a browser all in XAML but not sure how you host files locally (reflection) and it may not be that easy to target the XAML from the c sharp or vb nethttp://twelvestone.com/forum_thread/view/36207
But I guess if your using vb6 then you can effectively use fscommand, but you read that thread already.. http://twelvestone.com/forum_thread/view/28353
but also look at this ruby in vb6 I think the example included with the download stuff includes flash communication http://twelvestone.com/forum_thread/view/28354
also found thishttp://www.flashfanatiker.de/blog/archives/000032.html
then if you search on fscommand and vb6 http://www.adobe.com/devnet/flashslideshow/articles/data_exchange.html http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001727.html
Wow! JLM thanks very much. Sorry I didn't post to thank you earlier I have just been going through all of that trying out various things. There is an infinite number of options you have given me and its all so fun. JavaScript reading Flash variables is my interest, high high interest. I'll tell you if I'm succesful and I'll let you know how to do it!
Or i'll post for more help haha
What I'm doing is using javascript injection to read flash objects values. I have no control over the SWF files as they are not mine. This is my only goal
I might be nieve but just had a thought - you sound like your making life hard for yourself... can you not load the movies into _level1 of a holder movie, in the holder movies _level0 you can create code to control and output what ever you want about the _level1 movie, I would explain it more, but it could be used for the wrong purposes and I am sure you can work it out from what I have said.
Originally posted by: JLM I might be nieve but just had a thought - you sound like your making life hard for yourself... can you not load the movies into _level1 of a holder movie, in the holder movies _level0 you can create code to control and output what ever you want about the _level1 movie, I would explain it more, but it could be used for the wrong purposes and I am sure you can work it out from what I have said.
Hmm I dont understand. I would so like to learn more about this, I am using javascript to do getvar what do you mean load the movie into another movie. Do you mean like my flash movie loads this then after that do i use actionscript to read variables and then use from my movie send it to the javascript? My purpose is to just auto play same flash games. Its just a challenge I have had for a while now. I think i am making life hard hahah I was so busy trying to go through all the sources in your previous post i did not see your latest post.
Thanks again JLM I've been trying to read variables in theese annoying games for months now (as you can see i started with vb and now im and js and still trying haha.) I think this might be the solution! 
Ok this is the theory I don't really know if it exactly fits your problems and I will assume that you do not have bad motives as this can be powerful stuff, but hay even if you did which is not my concern it takes skill anyway which normally comes with responsibility.
You want to have power over movies without editing them, querying, overwritting functions and control the movies timeline... if you flare or in some way see the code structures in a swf and you have a fair bit of inteligence and even luck then you can load the movie into your movie and inject replacement functions and target and control movieclips to adjust the swf to your requirements.
For instance a slighlty off topic examlpe, I played with a flash IDE alternative during its private beta and bitterly complained about the lack of for all loops etc.. and while most actionscript was implemented, it lacked prototypes, but by loading a flash movie with a generic function for creating prototypes I could get the application to create prototypes by calling this function. Sort of an inverse of the concept I am suggesting.
Now most movies have a habit of referencing the _root, so you can load them into a holder movie but then they will fail because the _root is no longer the _root. Now coders can bitch about people referencing the _root, but honestly it is rare for movies to not ever reference the _root. So my suggestion is to load the movie into a _level so it is at _root level, which may work. Alternatively you can use lock root (check syntax) to give the loaded movie a virtual _root. Note that while a virtual root sounds like you will loose access to your root the real root is often accessed by _root._parent.
Now your holder movie can use external interface or whatever to talk to javascript or use something like Depot maybe, or you could write a swf holder on the fly by extending something like SWXformat.org or use ming.
From in flash you have a lot of control and power over loaded in movies, far more than from outside the swf format. That is all I was trying to explain.
Whoa dang thanks man I'm going to try work on that. All I want to do is read variables like for instance this is the code to one movie i have loaded: function takekeyup() { _l1 = _root; if (lastkeydown == 32) { if (_l1.meter.moving == 1) { _l1.keyupcode = ""; _l1.keydowncode = ""; Key.removeListener(_l1.myListener); _l1.lever.enterframecode = ""; _l1.lever.rstep = 0; _l1.dartapultcharge.stop(); _l1.meter.moving = 0; _l1.meter.stop(); var _l3 = _l1.meter.bar._xscale; var angle = _l1.lever._rotation; attarget = 0; _l2 = 0.400000; _l1.bolt.gy = 1.500000 * _l2; _l1.bolt.gx = 1.500000 * _l2 / 10; _l1.bolt.ystep = -_l2 * _l3 * _l1.newcos(angle); _l1.bolt.xstep = _l2 * _l3 * _l1.newsin(angle); _l1.dartapultshoot.start(0, 1); _l1.enterframecode = _l1.boltfly; } // end if } // end if if (lastkeydown == 38 || lastkeydown == 40) { _l1.lever.moving = 0; _l1.lever.rstep = 0; _l1.dartapultmove.stop(); _l1.lever.enterframecode = ""; } // end if _l3 =; _l2 = _l2; _l1 = _l1; } // End of the function And I want to do getvariable on _l1.meter.moving but I can't manae that with javascript :(
That's basically what I'm doing just trying to read different variables. Am I making things really tough on me, or am I just not calling the getvariable right? :(
well you can trace it so you create a movie to load the swf...
loadMovieNum(other.swf,1);// ( check syntax )
onEnterFrame = function () { if(_level1.meter.moving!=Undefined){ _root.outgoing = new localConnection();
_root.outgoing.send('window2window', 'setMessage', String(_level1.meter.moving));
delete _root.outgoing;
}
};
and then you create a movie that you run in flash to read the value to the trace window.
incoming = new LocalConnection();
incoming.setMessage = function(data){trace(data);};
incoming.connect("window2winidow");
well that's the concept anyway, you just need to pass the var to javascript rather than localconnection. Must admit i think this is about as much info/help on the subject as I can give as basically I am explaining how you could hack someone elses movie and so beyond the concepts that could be applied for good or bad I feel it is up to you to work the details out.
Good luck
Thanks so much JLM its all good I'm not using for malicious purposes. Thanks so much for the help this is unbelievably helpful. I have been stuck on this for months literally.
well if you managed to sort thing that is good. But if not - time permitting; If you can pm me context then I can try to help further if possible. cheers ;j
Aw man I still have not been able to solve this. I bought myself a copy of Flash CS3 and am now trying to load in the movie. But I'm a javascript person lol
JLM man you still around? 
If you got a spare few minutes I could use some help
No rush though please at your own leisure.
Its been over a year and half and still can't figure it out. But I just got CS3 so I'll keep working with it and am hoping i can pull this off. im pretty sure about the solution you provided (loading the movie into my flash movie into _level1 holder)
you can't add code to a certain .swf? Is this the crux of the problem?
I'm confused.
FWIW:
ExternalInterface.call("nameOfJSfunction", varYouWantToSendtoJS);
Well I really want to just read some variables from the swf in the browser but injecting javascript ie: document.getElementById('myFlashMovie').GetVariable('_level10.score')
But I haven't been able to access it like that so JLM recommended I load the swf into my own swf then try. So I was trying that. Im totally new to flash so I was hoping for a link to a tutorial or something to show me how.
I don't know if "Reading" is the best way to build an application. Flash should be triggering JS and that is what ExternalInterface is for.
put your document.getE in a JS function and send the variables from Flash to JS as I wrote you above.
ExternalInterface.call("nameOfJSfunction", varYouWantToSendtoJS1, varYouWantToSendtoJS2, blah, blah);
Honestly, this is why companies should pay Flash guys to do Flash stuff and Adobe thought by making Flash more "codey" that developers could jump into building Flash and take over the world!!
Flash is brilliant for what it can do and I think you're approaching this from the wrong angle.
I don't have access to the flash. The flash files are actually games on blah.com. So I have no control over it. I just want to GetVariable on some variables and display it in the browser to make it look a bit cooler, its something my little bro has wanted me to do forever and this is the one thing I haven't been able to do so its really bugging me. How I want to accomplish it is with simple javascript. It works on some files and on others it doesn't. I just need help understanding the paths to the variables I think.
So the thing is I just can't access the variables properly.
ok now I know why JLM was talking localconnection....makes sense now.
Ok, so you KNOW the variables you need from the game, correct? You tried building a container .swf that loads the .swf game over top as JLM suggested? Can that base .swf read the vars you need from the game?
Originally posted by: Storm ok now I know why JLM was talking localconnection....makes sense now.
Ok, so you KNOW the variables you need from the game, correct?
You tried building a container .swf that loads the .swf game over top as JLM suggested?
Can that base .swf read the vars you need from the game?
Sorry about the poor explanation earlier :(
Yes sir, I know the variable names, I just am having problems accessing it. JLM suggested to contain it in my own flash movie. My first method would be to just use straight javascript but if that can't be done then I am all for this method. So now I dont know the first thing about writing flash files. I got the software now though finally so I was hoping maybe you can hook me up with a tutorial online and I can try that
Im a total beginner at flash.
hit F1 the best tutorials for learning Flash are right in there.
If you know the variables but can't edit the file, make YOUR flash file call that one as JLM said, then store all those variables in your own movie. Use ExternalInterface to pass those to JS.
If you want a straight JS solution, I can't help.
In firefox help?http://support.mozilla.com/en-US/kb/Firefox+Help?style_mode=inproduct?
Thanks storm and jlm 