Passing data from Flash to MATLAB through Javascript
2 次查看(过去 30 天)
显示 更早的评论
I have an Adobe Flash app (on my local machine) which is basically a simulation. I embedded the swf file in an html which receives the needed parameters using javascript callbacks (passed from flash with ExternalInterface). I can put the values in text boxes, etc. I need to get these values into MATLAB.
I understand javascript can talk to MATLAB using the built in web browser. The built-in browser will not run the Flash content, however. I need one of the following:
A. (best) A way for Flash to run in MATLAB's web browser. I am on a mac if that's relevant.
B. A way to do the "matlab:[command]" javascript calls from firefox, chrome, or any other.
OR
C. A clever trick to send values from a browser to MATLAB.
Thanks!
2 个评论
回答(2 个)
Ajay Pherwani
2015-1-6
编辑:per isakson
2015-1-6
Try something like this:
url = 'http://www.example.com/';
html = urlread(url);
% Use regular expressions to remove undesired markup.
txt = regexprep(html,'<script.*?/script>','');
txt = regexprep(txt,'<style.*?/style>','');
txt = regexprep(txt,'<.*?>','')
you can search in txt further
ryanmattscott
2016-4-7
Matt,
I have a similar problem, were you able to figure something out? I could do try to save a file using a php server and then use webread( ) on the url, but I would like to have some handshaking so that I don't webread as php is writing to the file.
- Ryan
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!