Making actionscript global & portable

Forgive me if this is the improper forum for this question. I
am certain that if it is, someone will kindly re-direct me. What
can I say, I'm sort of a noob.
Anyway, I have a single frame .swf file that is mostly
actionscript that is triggered by a set of buttons. It works a
charm in it's monolithic form. But what I need to learn is how to
build a portable "movie clip" that would contain my actionscript
and be able to drag that item into any flash document, build some
buttons on different frames and have the script run properly.
For example, in my file I have two buttons called "iplay" and
"ipause" that, through actionscript, send data to a php file.
If I try and build a movie clip and place the AS in that and
place the buttons in another layer, they don't work.
Some gentle push in the right direction of making my work
"global" even when contained in a clip would be greatly
appreciated.
Thanks!

automatiktrey,
> I have a great deal to learn here but ultimately, I
think
> you are correct.
> The big issue now is that I want to include my code into
> someone else's project which was created in ActionScript
> 1 but their work seems to deprecate to AS2 so I should
> be OK.
If they can update, that's ideal. If they can't, you can
write your
code in prototype-based classes (not "really" classes, but
conceptually
similar). I recommend AS2, don't get me wrong, but if this
code must be in
AS1, check out this other tutorial, which describes how an
object-oriented
approach can be done in AS1 (happens to be how it's done in
JavaScript,
too). Don't let the two approaches confuse you! I don't mean
the muddy the
waters at all -- just trying to give you a few more options.
http://www.debreuil.com/docs/
David Stiller
Adobe Community Expert
Dev blog,
http://www.quip.net/blog/
"Luck is the residue of good design."

Similar Messages

  • Making variables global i iAd Producer

    sorry if this is a really simple question. Still, I am stuck:
    I would like to have widgets access other widget's variables. I would have thought, for instance, that it would be possible to declare a variable
    var Utility = this.viewController.outlets.Utility;
    in Global.js, refering to a widget declared in one of the standard auxiliary (.js) files.
    I assume that there are more clever ways of doing this. I'm not new to programming, but I'm new to both iAd Producer and JavaScript.
    Any and all pointers welcome.
    Thank you,

    For security reasons, each widget in an iBooks Author book can only access it's own content.
    If you meant sharing across pages in a project, then Global.js is the place to store the variables. It's best to assume Global.js can NOT see anything on individual pages, so your idea of using "this.viewController…" likely won't work. Instead, define your Utility class in Global.js (or in another JavaScript file you added as an asset), and reference the objects therein directly from the code in your pages.
    Does that help?

  • Making JRE smaller (portable)

    I've already done a simple application and I wanted to make it as portable as possible... I'm using jre1.60_02 which, compressed, is about 17mb and my application, is a .jar file which size is less than 50 kb.
    I've read in README.TXT (which installs with jre) i could remove a couple of files... anyway... those files rerpresent 1 or 2 mb...
    Is there any way to make it smaller keeping it legal :) ?
    I've removed this files under windows (if i've removed a file i shouldn't have please let me know)
    lib\ext\sunjce_provider.jar
    lib\ext\localedata.jar
    lib\ext\ldapsec.jar
    lib\ext\dnsns.jar
    bin\rmid.exe
    bin\rmiregistry.exe
    bin\tnameserv.exe
    bin\keytool.exe
    bin\kinit.exe
    bin\klist.exe
    bin\ktab.exe
    bin\orbd.exe
    bin\servertool.exe
    bin\javaws.exe
    lib\javaws.jar
    bin\java.exe
    bin\javacpl.exe
    bin\jucheck.exe
    bin\jusched.exe
    bin\wsdetect.dll
    bin\npjpi160_02.dll
    bin\NPJava11.dll
    bin\NPJava12.dll
    bin\NPJava13.dll
    bin\NPJava14.dll
    bin\NPJava32.dll
    bin\NPOJI610.dll
    bin\RegUtils.dll
    bin\axbridge.dll
    bin\deploy.dll
    bin\jpicom.dll
    bin\javacpl.cpl
    bin\jpiexp.dll
    bin\jpinscp.dll
    bin\jpioji.dll
    bin\jpishare.dll
    lib\deploy.jar
    lib\plugin.jar
    lib\javaws.jar
    Any ideas?
    Thanks four your time :)

    Is intellectual curiosity dead? Why do some front-end developers spends zero time learning the architecture and concepts of a back-end database before throwing code over the cubicle wall?
    Your questions screams loudly that you have invested no time in learning anything in Oracle beyond, perhaps, SELECT * FROM t.
    No you can not do that. No Oracle is not brain-dead MS Access.
    If you want a portable application put away the toys, read the concept and architecture docs at http://tahiti.oracle.com, and perhaps create your application using Application Express.

  • Differnace b/w SID and Global data base name

    please tell me what is differance b/w SID and global data base name.

    Hi,
    Oracle System Identifier (SID)
    A name that identifies a specific instance of a running pre-release 8.1 Oracle database. For any database, there is at least one instance referencing the database.
    For pre-release 8.1 databases, SID is used to identify the database. The SID is included in the connect descriptor of a tnsnames.ora file and in the definition of the listener in the listener.ora file.
    http://download-uk.oracle.com/docs/cd/B19306_01/network.102/b14213/glossary.htm#i433004
    Global database name
    The full name of the database which uniquely identifies it from any other database. The global database name is of the form "database_name.database_domain," for example, sales.us.acme.com.
    The database name portion, sales, is a simple name you wish to call your database. The database domain portion, us.acme.com, specifies the database domain in which the database is located, making the global database name unique. When possible, Oracle Corporation recommends that your database domain mirror the network domain.
    The global database name is the default service name of the database, as specified by the SERVICE_NAMES parameter in the initialization parameter file.
    http://download-uk.oracle.com/docs/cd/B19306_01/network.102/b14213/glossary.htm#i435858
    Adith

  • Changing a global swatch

    We've purchased an eps file that claims that you can change the global swatch settings, but when I double click the swatch and change the color - it doesn't change anything.  If I cursor over the entire art and double click the swatch to make the change, it changes the entire art to a single color.  This art has hundreds of sections within it - with lots of various gradients in it.  If I choose a single layer to change the colors in the gradient - I can't get the gradient colors to show up, nor can I even get it to change over to the standard black and white gradient.  So, I don't know what to do here.  Am I doing something wrong here in making the global swatch change?  If I didn't know better, I'd say that the art has been completely divided.
    Suggestions?
    Thanks,
    Ron

    This is from iStock and claims within a note on site that it is set up with a Global Swatch. 
    The blue swatch in the pic you are talking about may have been one that I adjusted in an earlier attempt to change out the swatch color, but had no effect... I'm assuming that is the case.
    Otherwise, I can't even understand why the eyedropper doesn't recognize a color in the gradient...
    It's looking this will have to returned.

  • What is the maximum number of globals allowed in one global file?

    I remember there was a limit discussed in a LabVIEW class, but I can't remember it. But I know I exceeded the number on one project and VERY WEIRD things happened. Does anybody know this number?
    Thanks Much

    HI Tbob,
    You are going to earn the title of Global Enthusiast if you keep this up
    Race conditions are to Globals as Venerial deseas is to sex. If you want to avoid the former then abstain from the latter.
    Yes you can use globals.
    In fact, I ran a benchmark comparing how fast I can read a global booean vs the same coded as a LV2 global. The Global booean was 6 (or was it 16?) times as fast.
    When answering Q's that use phrases like "strange things" we bring up the race condition and point users to LV2's.
    Sure text based programmers learn how to handle global access in multi-threaded environments. These types of interaction are implemented by making the global a protected section that are protected using semaphores. This same approach can be used to protect LV globals. Just ensure all reads and writes of teh globals are only done after acquiring the semaphore that protects the global. If you did thisfor all accesses to the global you would not have race conditons with globals.
    Unfortunately this is a lot of work because now you have to deal with creating acquiring releasing the semaphores and this has to be done for each value you need to protect from simultaneous access.
    Now if there was an easier way well then....
    BUT THERE IS!
    It turns out that when a VI is not reentrant (like in a LV2) LV implements a scheme that prevents simultaneous execution of the VI. So by using a LV2 you pick-up the resource locking with ZERO EFFORT!
    So being lazy, I use the method that is imune from race conditons from the very begining. That way when my customer asks "Can I manipulate the cal values from any of the machines on the network?" I can say "YES, that was functionality is supported by the design".
    I could not say that if I implemented the cal via globals.
    So that is why I push LV2's and and discorage globals.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Globals in crossdomain swf's (AS2)

    Hi,
    I have two domains (on the same server) each of the domains
    contains a crossdomain xml and swf's. The swf's have
    System.security.allowDomain("*") set.
    From 'domainOne' I start the main swf. This main swf loads
    (with a loader component) a swf from 'domainTwo'. So var so good.
    In the main swf on 'domainOne' I have some _global functions.
    When I call these global functions from the second swf (from
    'domainTwo') nothing happens.
    My question: Is it possible to call global functions between
    crossdomain swf's? If so, what's the trick?
    Thanks

    I have found something that could be the problem:
    http://www.adobe.com/devnet/flash/articles/fplayer_security_04.html
    It says:
    quote:
    When two movies are from different domains, Macromedia Flash
    Player ensures that the two movies have different copies of the
    ActionScript global object. The global object is usually implicitly
    referenced. For example, all objects in the Macromedia Flash Player
    standard library, such as MovieClip, Array, and so forth, are part
    of the global object. The global object also holds global variables
    created by assigning properties to _global. Separating global
    objects between movies from different domains has occurred since
    Macromedia Flash Player 6. However, Macromedia Flash Player 7
    introduces a new restriction: movies made for Macromedia Flash
    Player 6 or earlier can never share a global object with movies
    made for Macromedia Flash Player 7 or later, even when the movies
    are from the same exact domain and protocol. This may have subtle
    repercussions for sites that mix movies made for Macromedia Flash
    Player 6 and 7.
    But I find this very stange, especially if you use
    System.security.allowDomain(); this should grant the swf access. Or
    am I wrong here? (I only use player 8 files, thus no mixed ones)
    Any ideas?

  • Storing global variable

    Hey there
    I'm trying to figure out how/if you can store a global variable, for access in all classes of the program. In this case I am developing an app which connects to a database. At the moment each class makes a seperate connection to the database for it's purposes, but I would rather make one connection at the beginning, and then each class shares this connection. I realise I can do this by having each class constructor accept a connection, and then just threading the connection to all of them. However, is there a way I can just store that connection somewhere in memory, and access it from all classes. I remember being able to do this in C# so hopefully Java has something similar.
    Thanks
    Nathan

    I don't know how this got into the JDBC forum, but a
    basic way of making a "global" variable is like
    this:public class User {
    public static Connection theConnection;
    }Then other classes access it like
    this:Connection conn =
    User.theConnection;When you learn some Java
    you'll find out that this is primitive programming and
    there are better ways, but this will do for a raw
    beginner.It's quite sad that you say this, I have been using java in my degree for the last 3 years. I guess we haven't developed applications from scratch, but I've done tons and tons of assignments in Java. The fact that I'm still at raw beginner level scares me. Perhaps I should not be looking for a programming job next year.

  • Global 'Sound on/off' option?

    Hi;
    Is there a way of making a global 'sound on/off' button that will work across the entire set of articles in an app? or do you have to have a button on each article, that controls just that one article?
    thankyou

    Hi;
    Is there a way of making a global 'sound on/off' button that will work across the entire set of articles in an app? or do you have to have a button on each article, that controls just that one article?
    thankyou

  • Need to export data from reporting server to SharePoint List

    I have built a rudimentary dashboard using Excel and PowerPivot Gallery on SharePoint 2010.  I successfully exported the first dataset to a SharePoint List that I can access from my dashhboard, making it fairly portable. (Whoop!)  I've also found
    that I can create a bunch of new lists.  But I have not figured out how to update these lists daily.
    The most critical is an existing Odata connection:
    DataFeed_2_teams-company-com IMData.  I am trying to update that list from the new report (.xls format).  After saving it as .xlsx then closing and reopening, Odata and the existing connection are now enabled.  But when I try to connect,
    Excel tells me, "We can't use the data from this feed.  Make sure the external data feed server is available and that your connection information is correct."  The connection is available and I'm using the "authenticated user's account".
    I really don't mind if the data is deleted every day.
    Any ideas?
    -=-=-=-=-=-=-=-=-
    Another thing I've tried is exporting the data through the Table menu.  But since the list already exists, I can't do anything with it.
    Adios, Clay Harryman

    Hi,
    Do you have your Odata connection stored in a sharepoint list zo you can reference to that point?
    Maurice
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer. Thank You

  • How do I use itunes from an external HDD on a new laptop?

    This really does seem to be an unanswerable question but you guys have helped so many times in the past without me ever having to post.
    Here is my set up when I first got iTunes way back I had it on my first laptop, we'll call this PC A, but the Hard Drive was so small I moved the library to my external HDD. I say I moved it, a friend did it for me.
    For years this set up worked fine, iTunes was on the HDD and I would access it via PC A as long as the two were connected. If the HDD wasnt connected then I couldnt access iTunes, of course, as all of the library was stored on the HDD.
    I dont want to sound like I am talking to you all like idiots but Ive explained this so many times and people never know what I mean.
    So now I get another laptop. (PC B)  but obviously I cant get to iTunes from it even when the HDD is attached.
    For years I used to crank up old PC A and get to iTunes that way but now the old girl is on her last legs so I need to be able to access iTunes from PC B (this has been going on so long Im now looking for PC C).
    I do have iTunes on PC B that my iPhone is synced to and they seem to understand that each other exists but if I plug my iPod that is synced with iTunes from PC A with PC B it wipes it
    Please. Please. I just need to know what to do

    Make a split library portable
    Here are the typical layouts for the iTunes folders:
    In the layout above, with the media folder (everything in the red box) inside the library folder, the library is considered to be portable. A portable library can be moved from one path to another without breaking the links between the library and the media and being self-contained is much easier to backup.
    You can rearrange things to make a split library portable by taking a number of small steps which don't break the library.
    Before you start any media files that are outside of the media folder will need to be consolidated. If the library is in the old style layout then it should ideally be be upgraded to iTunes Media Organisation (Library > Organise Library > Rearrange files in the folder <Media Folder>) to ensure that iPod Games, Mobile Applications etc. are brought inside the media folder.
    The basic non-fatal manipulations are:
    You can connect to an alternate set of library files by holding down Shift (Win) or Option (Mac) when starting iTunes.
    You can move the library files to a new location as long as the media stays put.
    You can move the library files and the media together if the media folder is a direct subfolder of the library folder. (I.e. in this form the libary is portable).
    If you have already moved/copied the media content from a subfolder of the library folder to a different location then you only need to copy the library files for it to appear as if you have moved the entire library in the way allowed above. I.e. just copy the library files into the parent folder of the media folder.
    You can rename the media folder to iTunes Media (if it isn't already) if the media folder is inside the library folder.
    iTunes uses the name of the folder holding the library files as the window title. Having made a library "portable" you may need to take a final step of renaming the library folder to iTunes or, if the library files have ended up at the root of a drive, moving all of the library files and content folders into a new folder called iTunes.
    After each change you need to open, test and close the relevant library before attempting another change. If a change broke the library, undo it or revert to using the previous set of library files.
    In essence all you need to do to make your library portable is copy the library files into the parent folder of the media folder on the external/secondary drive and use the hold-down-shift/option-when-starting-iTunes method to connect to it. Other manipulations may be required to normalize the library so that the library and media folders have standard names.
    If you are making the library portable in advance of migrating it from one system to another, don't forget to deauthorise the old computer if you're not planning to use iTunes on it again.

  • Help uploading some jars on a mac

    Hi guys
    I'm new to java and i'm following a course at university.
    We have some pre-made jars from our teachers but i'm having some difficulties importing them.
    Basically those .jar files are on a cd, the Windows path says "C:\ProgramFiles\Java\jdk1.6.0_04\jre\lib\ext"
    I'm trying to find the same path on my mac but i simply cant.
    I'm using eclipse as IDE, if i try to import it from the IDE selecting "import>File System" the .jar files are shadowed and i cannot select them.
    Any help?
    Thx a lot
    Enrico

    classboy wrote:
    Hi guys
    I'm new to java and i'm following a course at university.
    We have some pre-made jars from our teachers but i'm having some difficulties importing them.
    Basically those .jar files are on a cd, the Windows path says "C:\ProgramFiles\Java\jdk1.6.0_04\jre\lib\ext"
    I'm trying to find the same path on my mac but i simply cant.
    I'm using eclipse as IDE, if i try to import it from the IDE selecting "import>File System" the .jar files are shadowed and i cannot select them.
    Any help?Well, on a Mac they'll probably be in a different place (possibly /usr/bin, but I'm not familiar with the machine). You could try using 'find' to locate directories starting with 'jdk'. Assuming you actually have a JDK installed, the subdirectories should be the same.
    BTW: It's not usually recommended to put non-Sun jars into jre/lib/ext, but people often do it as a way of making them globally available. An alternative is to simply put them somewhere you'll remember, and then import them into your Eclipse project.
    Winston

  • Something weird happening with View Options....

    Hi!,
    OK, so I go into my hard drive root (where the library, users, system folders are). I go to the View menu and choose Show View Options. In that small panel, I check the Show Item info checkbox so that it shows me all the info about folders. I enable it and close the window. Now under all the folders, it says how many files are indside them. All the numbers were correct and I was happy until I noticed that the printing underneath the Applications folder said that there were no items inside. So, I went into the applications folder and all my apps are still there (phew!) . I logged out and logged in to see if that fixed it but NOPE, it still had "Not items" under the Applications folder. Whats goin' on?
    I know that this may be a small problem with nothing to worry about but I'm afraid that all the other options may be going crazy as well. Is there a pref file I can trash?
    Any help is appreciated
    Indragie

    Hi Indragie,
    You must not have noticed the option at the top of the View Options box. The radio button for "All windows" must have been on. So you ended up making a global change. Perform a View Options command again and reverse it by turning off the "Show Item" info with the same "All windows" option on. That will clear that setting from all other folders. In the future, watch that option carefully and make sure to set it first.

  • If i previously had my iTunes library set up on an external hard drive, how do I get my iTunes on my new mac pro to operate off of the same hard drive?

    I recently bought a mac pro. I previously had a macbook that I had set up for iTunes to run off of an external hard drive. How do I set up my mac pro to run off of this hard drive?  I have been trying to figure it out for the last hour and have had no luck.
    I have tried to move my itunes folder on my mac pro to my external hard drive but am having no luck. Any help will be appreciated. Thanks.

    If you had the entire library running from the external drive it should be a matter of holding down option as you start iTunes and browsing to the library on the external drive.
    If you'd followed the advice to move the media folder only then ideally you need to recover the library folder from your Macbook with a view to making the library portable on the external drive.
    Otherwise you're going to have to simply import the content into a new library, losing rating, playlists, play counts. etc.
    If you have any devices that sync to your library see Recover your iTunes library from your iPod or iOS device.
    tt2

  • ITunes can't locate some files that are right where they should be

    I'm using iTunes 12 for Windows.  I keep a huge iTunes library at home on a mapped NAS share and the same library at work on a local drive.  Every week on Monday I sync my entire iTunes folder from home to an external drive and then bring that external drive to work and sync it to my local drive there.  (Note: This is a one way sync; I never sync in the other direction.)  This system has worked flawlessly for six years.
    Within the last six weeks, I've started to get error messages on my work system saying that many (>1600) media files of various types cannot be located.  I assumed corruption was the issue so I deleted my entire 500GB iTunes folder and re-copied everything back over.  Not just the media files.  Everything.  The problem persists and I cannot figure out why.
    I have confirmed that iTunes on the work computer is referencing the correct iTunes library file.  I have confirmed that iTunes is pointing to the correct iTunes folder.  I have confirmed that the "missing" iTunes files are right where they should be.  (I have always had iTunes set to move imported media into the iTunes folder so there is no stray media floating around on either system.  And I have iTunes set to organize the media.)
    It is worth noting that I started seeing this around the time when I upgraded to iTunes 12.  When I upgraded to iTunes 12 I had to change the path to my home library from "\\<NAS>\iTunes\iTunes Music" to "M:\iTunes\iTunes Music" due to a bug in iTunes that created iPhone syncing issues if the iTunes library is on a network drive.  But I can't figure out why this would matter.  The path on the work computer is correct and all media files are there.
    Ideas? I just don't understand how deleting everything and starting over doesn't solve the issue since there is NO issue at home.

    Thanks again for your help with this, tt2.  (I keep wanting to call you "Alan".)
    I totally botched the repair process, including my library and media collection, four different times.  If not for the fact that I had a complete, up-to-date copy of my library and all media files I would be completely scr3wed right now.  I'm going to outline the mistakes I made for the benefit of those who might reference this thread in the future.
    A big part of my struggle was the underlying assumptions I was making about how the iTunes database is maintained and tracked.  It is not the same as the digital asset managers I use for work—Lightroom, for example.  I really had to quit thinking for myself and pay attention to what tt2 wrote about the way the iTunes db works in the link he provides earlier in this thread about making split libraries portable.
    The biggest mistake I made is failing to understand that after you move the iTunes library files (but not the media files) to a new iTunes drive or directory outside of the existing iTunes folder and then shift-click to open that relocated library in iTunes you have to set the iTunes Media folder location (in preferences>advanced) to the empty iTunes Media folder in the NEW iTunes folder.  You do NOT set it (or leave it) pointed to the old iTunes Music/Media folder where your files [may] actually reside before consolidation.  This mistake can make a bad situation much worse. 
    Finally, I did not have a split library in the sense that my media files were outside of my iTunes Media folder.  Because of this, when I incorrectly pointed the new iTunes library to the old iTunes Media folder and then consolidated I created 9,936 duplicate files.  I had a complete back up which made eliminating the duplicate files a simple process.  Without the backup I would have been in trouble.
    So...to fix my problem I followed tt2's instructions and did this:
    Backed up my entire M:\iTunes folder including libraries and media files.  If everything goes well, this backup will not be touched.
    Created a new A:\iTunes folder plus an empty A:\iTunes\iTunes Media folder.
    Moved everything from M:\iTunes to A:\iTunes EXCEPT for the iTunes Music* folder.  (*It was the new iTunes 9 and later hierarchy but with the old name.)
    Shift-Clicked to open iTunes and selected the iTunes library inside A:\iTunes.
    Once iTunes was open I went to Edit>Preferences>Advanced and made the empty A:\iTunes\iTunes Media the location of my media.
    Went to File>Library>Organize Library and choose "consolidate". After hours of file copying, my issue was resolved. A:\iTunes is portable.
    Confirmed that the new A:\iTunes library correctly links to all media in the A:\iTunes\iTunes Media folder and then deleted the M:\iTunes directory with the old M:\iTunes\iTunes Music folder inside.
    NOTE: It bears repeating that the problem solved was that I could not move my old M:\iTunes folder to a different workstation w/o breaking some of the links.  However all the links worked fine in the M:\iTunes location.  If this were not the case then this solution will not resolve anything. 

Maybe you are looking for