Can ActionScript check windows registry?

  • janice_2k
  • Novice
  • Novice
  • janice_2k
  • Posts: 28

Post 3+ Months Ago

Dear Gurus and members,
I am a newbie in ActionScript. I developed an e-learning website using mostly Flash MX 2004 and ActionScript 1.0. I plan to create a record/playback plugin using media control interface (MCI). The plugin is a one time installation. During the installation, the installer will store a value in the user's window registry. In that way, whenever user clicks on the record/playback button, it will check the user's window registry for the value. If it exists, it will display the record/playback pop up window. Otherwise, it will request the user to download the plugin before proceeding.

Is there any sample codes or can someone share with me the sample codes in checking for the registry value, prompting message if value does not exist? If can't how can ActionScript check for txt. file? I would like a set of sample codes as well.

Summary:
1.How to write the ActionScript that checks the existance of a value in the registry using System.Registry.read?

2. How to write the if-else statement whereby, if the registry value exists, it will run the MCI record/playback plugin; Otherwise, it will prompt a message to request user to download the plugin?

Hope to hear some reply soon. Thanks in advance!

Cheers,
Janice
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • rynoe
  • Banned
  • Banned
  • User avatar
  • Posts: 17

Post 3+ Months Ago

You need to use a server side language. Actionscript does not write to files.
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

Server side scripting will not work on a local system.

Flash cannot check registry entries as that is a huge security risk.

Actionscript cannot check if a .txt file exists either. However you could try to load in the text file via the LoadVars() object, and if the file fails to load you can initiate the appropriate actions. That would go a little something like this...

Code: [ Select ]
myLV = new LoadVars();
myLV.onLoad = function(success){
  if (success){
    //do what you want if file gets loaded
  } else {
    //do what you want if file fails to load
  }
}
myLV.load("yourTextFile.txt");
  1. myLV = new LoadVars();
  2. myLV.onLoad = function(success){
  3.   if (success){
  4.     //do what you want if file gets loaded
  5.   } else {
  6.     //do what you want if file fails to load
  7.   }
  8. }
  9. myLV.load("yourTextFile.txt");
  • janice_2k
  • Novice
  • Novice
  • janice_2k
  • Posts: 28

Post 3+ Months Ago

Thanks for your information. May I know whether the LoadVars() object is ASP or Javascript? Will it cause the pc to display the download pop up window even if user already downloaded the program to the computer? Hope to hear some reply soon.

Thanks in advance,
Janice_2k
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

The LoadVars() object is in ActionScript (the language of Flash), and it will do what you need it to do (as long as it's within Flash's capabilities) as long as you tell it what to do within that if/else statement.
  • janice_2k
  • Novice
  • Novice
  • janice_2k
  • Posts: 28

Post 3+ Months Ago

Hi lostinbeta,
Thanks for your information and explanation. What will happen when the file gets loaded? Does that mean that the txt file will be opened on a browser or something else? The main purpose of my txt file is to determine the existance of the plugin. It doesn't have any other purposes. Mind if I ask whether can you help me in the scripts within the if-else statement? As I know nothing about ActionScript

Code: [ Select ]
  if (success){
    //If txt file gets loaded, calls plugin by displaying pop up window
    //Media Control Interface plugin is called--'one.exe'
  } else {
    //If file fails to load, it displays download pop up window,
    //requesting to download plugin.
    //The download plugin is 'SoundRecorder.exe'
  }
myLV.load("PluginCheck.txt");
  1.   if (success){
  2.     //If txt file gets loaded, calls plugin by displaying pop up window
  3.     //Media Control Interface plugin is called--'one.exe'
  4.   } else {
  5.     //If file fails to load, it displays download pop up window,
  6.     //requesting to download plugin.
  7.     //The download plugin is 'SoundRecorder.exe'
  8.   }
  9. myLV.load("PluginCheck.txt");


By the way, what does the last code (myLV.load("PluginCheck.txt"); ) mean?
Hope you'd help me in this. :oops: Thank in advance and looking forward to hear from your reply soon.

Thanks,
Janice
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

please use code tags, thanks. :)
  • janice_2k
  • Novice
  • Novice
  • janice_2k
  • Posts: 28

Post 3+ Months Ago

Thanks for reminding.

I would like to know whether is it possible to use actionscript LoadVars() object to call software created using Media Contol Interface(MCI) in the If-Else statement? The exe file was created using VB6. My main concern is whether can I call exe file in the If-Else statement in the LoadVars() object. How does the script looks like? Can anyone please help me with this as I am a total nuts in ActionScript. Hope to hear some reply soon.

Thanks in advance,
Janice

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 23 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.