Extending Flash - Flash JavaScript Question

This is probably not the place to post this, however I don't
know where to post it.
I'm attempting to use .jsfl to add a gradient to a shape. The
gradient fills fine with one problem, I can't rotate the gradient,
so instead of going from left to right to up and down:
var doc = fl.getDocumentDOM();
var fill = doc.getCustomFill();
fill.style = "linearGradient";
fill.colorArray = [ 0x000000, 0xffffff ];
fill.posArray = [0, 255];
var mat = fill.matrix;
mat.a = 0;
mat.b = 1;
mat.c = -1;
mat.d = 0;
fill.matrix = mat;
doc.setCustomFill(fill);
I would assume that the matrix object would affect this
however I cannot get it to work.
Thank you
-js

After a lot of trial and error I managed to figure it out.
The key problem here is that once a gradient is applied to an shape
it is difficult to modify it. I found that if I first fill the
shape with a flat color, then apply the gradient it works.
I was able to rotate the gradient 90 degrees and 45 degrees,
the code below rotates the gradient 90 degrees. To rotate the
gradient 45 degrees change matrix.a and matrix.b to 1. matrix.tx
and matrix.ty appear to do nothing.
var doc = fl.getDocumentDOM();
var fill = doc.getCustomFill();
fill.style = "solid";
fill.color = 0xffffff;
doc.setCustomFill(fill);
fill.style = "linearGradient";
fill.linearRGB = false;
fill.colorArray = [ 0x000000, 0xffffff ];
fill.posArray = [0, 255];
var mat = fill.matrix;
mat.a = 0;
mat.b = 1;
mat.c = 0;
mat.d = 0;
fill.matrix = mat;
doc.setCustomFill(fill);

Similar Messages

  • Extending Flash Javascript

    After finding out about the capabilities of (java)scripting in Photoshop, I'm curious to know if there's similar functionality for Flash.
    After some searching I found the 'Extending Flash'-documentation (please direct the currently inactive Flash Javascript-link on the Developers homepage to this page, it took me a while to find it), which seems to work fine but is rather shallow compared to the javascript possibilities in Photoshop.
    My questions:
    - Has there been any work on this since the CS4 scripting guide I found? Perhaps some functionality is complemented by Flex SDK, but I'm specifically looking for the functionality to automate the Flash Authoring Environment, for instance to have a swift way to replace texts, symbols or bits of ActionScripts in a SWF-file.
    - Is there a listener for Flash IDE like there is for Photoshop, i.e. a tool that converts your actions in Flash to JS-code?
    Cheers,
    Ruben

    i don't believe there has been much, if any, work extending the original jsfl code.
    to automate flash tasks, jsfl is the appropriate tool and there is no listener that will shortcut the coding for you.

  • Forum for Flash Javascript API

    I think there should be created a Forum dealing with
    questions to the
    Flash Javascript API
    regards Mads

    Thanks for responding, mclem
    I was trying to put it in a .fla, but apparently you can't do
    that, it seems that I have to use jsfl files. I'll be able to find
    all the support I need in the help files now, thanks ;)

  • How do I reboot my machine when it is flashing a question mark folder?

    How do I reboot my machine when it is flashing a question mark folder?

    Booting From An OS X Installer Disc
    1. Insert OS X Installer Disc into the optical drive.
    2. Restart the computer.
    3. Immediately after the chime press and hold down the "C" key.
    4. Release the key when the spinning gear below the dark gray Apple logo appears.
    5. Wait for installer to finish loading.
    After the installer loads proceed through the installation procedure.  If you are reinstalling Snow Leopard then your hard drive will not be erased.

  • Mac book pro flashing a question mark folder

    What does it mean when my mac book pro is flashing a question mark folder and will not boot

    There are four general causes of this issue:
    1. The computer's PRAM no longer contains a valid startup disk setting when there aren't any problems with the disk itself. This can be checked for by pressing the Option key and seeing if the drive appears.
    2. The internal drive's directory structure has become damaged. This requires usage of an alternate bootable system to perform the repair.
    3. Critical system files have been deleted. This requires usage of an alternate bootable system to reinstall them.
    4. The internal drive has died or become unplugged. This is the most likely case if the computer took a sharp impact or there are unusual sounds coming from the hard drive's location.
    (86432)

  • Flash javascript file into flash  doucments

    Hi surfers,
     How to connect the flash javascript file into flash  doucments?
    Thanks in Advance.
    Pls give me ASAP, i'm struggle here.

    you can use the externalinterface class in flash to communicate with javascript.

  • Intel and Adobe to Extend Flash Platform to TVs

    Intel and Adobe to Extend Flash Platform to TVs
    http://www.intel.com/pressroom/archive/releases/20090105corp.htm
    What does this mean for Flex developers?

    That's fantastic for Flex developers. The more places the
    Flash player is supported, the greater the opportunities for wild
    Flex applications. Go Adobe !!!

  • My old iMac (screen sits on a white dome) opens with a tiny folder that flashes a question mark, instead of a login to user's desktop

    My old iMac (screen sits on a white dome) opens with a tiny folder that flashes a question mark, instead of a login to user's desktop, when booting up after a forced shutdown. How do I get my operating system working again? Thanks --Jim

    The blinking question mark indicates that the firmware could not find a valid Operating System on your machine.
    Your harddrive may have failed. Your filesystem may have be come corrupted.
    Try these things.
    -- try to boot up from the installation disc.
    The startup manager will list all of your bootable partitions then give you a choice of which to boot.  Hold down the option key then power on. Continue holding down the option key until you see the startup manager. This brings up the startup manager. Click on your hd or disc. Click on right arrow key.
    -- Sometimes if volumes don't appear in Startup Manager (what you get when you hold down the Option key at startup), you need to reset the Mac's PRAM, NVRAM, and Open Firmware. Shut down the Mac, then power it up, and before the screen lights up, quickly hold down the Command, Option, P, and R keys, until the Mac has chimed twice more after the powerup chime.
    Then, before the screen lights up, hold down Command-Option-O-F until the Open Firmware screen appears. Then enter these lines, pressing Return after each one:
    reset-nvram
    set-defaults
    reset-all
    "The reset-all command should restart your Mac. If so, you have successfully reset the Open Firmware settings."
    http://support.apple.com/kb/TS1812?viewlocale=en_US
    Should the fail...
    Try taking the battery out for 10 minutes.  Put battery back in.  Cross fingers. Power the machine back on.
    How to eject a cd from the internal cd drive:
    eject cd
    List of devices:
    devalias
    List of variables:
    printenv
    More than you ever wanted to know about open firmware
    http://www.firmworks.com/QuickRef.html

  • Flash javascript problems

    I am attempting to get Flash - Javascript communication working using ExternalInterface.addCallback, using code found at http://kb2.adobe.com/cps/156/tn_15683.html. I am trying to pass parameters into Flash using a javascript function, but it only works if I insert a 'window.alert' line into the code. Once I click OK, the parameter str is passed into Flash ok. The function is:
                   function sendToFlash(str) {
            if (str=="tools"){
                window.alert(str);   
            getFlashMovie("richFunctionality_corp").sendTextToFlash(str);
            if (str=="components"){
                window.alert(str);
            getFlashMovie("richFunctionality_corp").sendTextToFlash(str);
    If I remove the window.alert, str isn't passed into Flash. Is this a browser speed thing?
    A value menu is passed out of Flash using getURL("index.php?pageID=239&menu=tools"), i.e. the page reloads and a php script  sends the appropriate str value to the sendToFlash javascript function based upon the value of menu.
    Help! I'm totally at a loss here and my javascript knowledge is very basic.
    Thanks...

    Using this:
    <?php
    if ($menu=="components"){
        ?>
    <script language="javascript" type="text/javascript">
    sendToFlash('components');
    </script>
    <?php
    if ($menu=="tools"){
        ?>
        <script language="javascript" type="text/javascript">
        sendToFlash('tools');
        </script>
        <?php
    ?>

  • Flash JavaScript API

    Most of the time I can solve my problems using google but
    this is probably something very silly that I'm doing wrong...
    The thing is that I cannot use the actionscript that extends
    flash, and I want to use the FLfile object:
    scripts like this don't work with me:
    alert("Process Complete");
    var folderURI = "file:///C|/WINDOWS" ;
    trace(FLfile.listFolder(folderURI, "files"));
    I use Macromedia Flash 8, and Flash Player 8/9

    Thanks for responding, mclem
    I was trying to put it in a .fla, but apparently you can't do
    that, it seems that I have to use jsfl files. I'll be able to find
    all the support I need in the help files now, thanks ;)

  • Extending flash - describing an entire scene within jsfl (for export)

    Hello,
    I am attempting to write an extension for flash which exports all keyframe/object/symbol data into a custom format. I have found this reference (http://help.adobe.com/en_US/flash/cs/extend/index.html) to extend flash, however it does not provide an overview how the data is organized within flash. I am an experiend actionscript programmer but have little experience with Flash Professional proper - so I'm too not familiar with the structure of layers, elements, frame, symbols - etc. Does someone have a resource somewhere that has all of this summaried? Or, better yet, has anyone attempted to export an entire scene, (layers, symbols, elements and all) into a different format (kind of like swiffy, but open source of course).
    Thanks!

    Hi,
    Yes I can send you the file if you like but after arriving back in today, and trying the many different versions I created every 15 or so minutes (as you stated), they are all doing the same thing - which makes me think it is a problem with the software on the machine I'm on?
    Any ideas guys? It still won't let me export or run, or save! And recently it won't even open some of the projects claiming it 'encountered a fatal error and cannot open the project'
    Any and all help is really appreciated
    Andy

  • Folder w/flashing gray question mark

    Hello,
    I have tried every and all the suggestions given here for when all that shows is a folder with a flashing gray question mark.  I was told that the reason for the flashing question mark is the hard drive is no longer working.  I have a lot of things on my computer and would like to make a back up of them, before I have it repaired. Is there anything else I can try to be able to reboot it and get all my files out of there? I'd appreciate any help or suggestions.  Thank you very much!

    Aqua
    Re: Folder w/flashing gray question mark 
    Feb 1, 2013 1:52 AM (in response to Arranques)
    Pram Reset shouldn't do that.
    How to use FireWire target disk mode...
    http://support.apple.com/kb/HT1661
    http://en.wikipedia.org/wiki/Target_Disk_Mode
    Can you or I be more specific?
    I know how to set up to get to the T mode.  What I'd like to know is, once I'm there, what is it that I'm supposed to do?  And can I be more specific about what? I just looked at the disc I inserted to be able to startup, and it is Tiger.  So the OS is Tiger and did have the computer partition. I had Tiger on one side and Leopard on the other.  I know, it keeps getting more complicated as I go along. Thank you for the links.

  • White screen with a flashing folder & question mark

    My IMac froze today and when I turned it off and then back on, it just sticks on a white screen with a flashing folder & question mark...  Help?

    Reinstall Snow Leopard without erasing the drive
    Do the following:
    1. Repair the Hard Drive and Permissions
    Boot from your Snow Leopard Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    2. Reinstall Snow Leopard
    If the drive is OK then quit DU and return to the installer.  Proceed with reinstalling OS X.  Note that the Snow Leopard installer will not erase your drive or disturb your files.  After installing a fresh copy of OS X the installer will move your Home folder, third-party applications, support items, and network preferences into the newly installed system.
    Download and install the Combo Updater for the version you prefer from support.apple.com/downloads/.
    Reinstalling Lion Without the Installer
    Boot to the Recovery HD: Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alterhatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the main menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu.
    Reinstall Lion: Select Reinstall Lion and click on the Continue button.
    Note: You can also re-download the Lion installer by opening the App Store application. Hold down the OPTION key and click on the Purchases icon in the toolbar. You should now see an active Install button to the right of your Lion purchase entry. There are situations in which this will not work. For example, if you are already booted into the Lion you originally purchased with your Apple ID or if an instance of the Lion installer is located anywhere on your computer.

  • Startup stuck on a Flashing Folder/Question Mark

    Aloha,
    I have been looking for a solution to my problem for several months now and have never found a solution.
    One day my computer froze so I forced a shut down by holding the on/off button.
    When I turned on the machine again the folder/question mark appeared.
    I have tried all the hot keys.
    Option-only shows the refresh and forward buttons but no options.
    I thought my hard drive failed, so I bought a new one and installed it.
    When I placed the OS DVD in to install a fresh copy I still got the flashing folder/question mark.
    I don't know what to do, any suggestions?

    sione wrote:
    I don't know how to get to the system preferences if i can't get past the flashing folder/question mark.
    Correct you'll not be able to...
    The question mark appears when the boot loader cannot find a valid OS system/partition.
    Here is what I would try:
    1. Boot from the OSX installer by inserting the disk into the Mac then power-off. Power-on the Mac and immediately press and hold the "C-key" until you get the installer Language screen. Select your language and continue. The next screen should be the Welcome screen, go to the top and select Utilities/Disk Utilities from the tool bar. Once Disk Utilities is open select your internal (if it appears) then select the first aid tab. In the first aid pane select to run "Repair disk". If "Repair Disk" results in errors then run it again until it reports no errors found. Once "Repair Disk" is complete with no errors then press and run "Repair Permissions". Once complete reboot to test the Mac.
    2. If the above does not work then try booting with the Startup Manager, by pressing and holding the "option-key" during boot. The GUI Startup Manager will appear and you can select the drive you wish to boot from.
    3. Alternately press the "X-key" during boot.
    4. And lastly before we give you the bad news... make sure that the mouse or track-pad button is not being pressed or stuck during system boot.
    If none of these works then you most likely have a bad drive. And you'll need to replace it. You do have a back up right?
    Do you have another Mac, to use for troubleshooting?

  • Installed Leopard, boots sporadically - Flashing Folder / Question Mark

    I have installed Leopard onto my PowerMac G4. It was working for a few months, now it won't boot up most of the time. I am getting the flashing folder/question mark when I turn the computer on.
    This problem doesn't occur all of the time. I was messing around with the two internal hard drives, switching them around inside the machine, and whatever I did must have worked because the computer booted up just fine. All of my files were in tact and everything looked normal. This lasted for about a day. Now my computer is back to the flashing folder on startup.
    What could be causing this problem, and how can I fix it? Thanks!

    Thanks for helping me, I really appreciate it.
    It is the strangest thing. Sometimes it will recognize the hard drive and boot up normally. Other times it hangs on the Apple logo with the spinning wheel. And other times it doesn't recognize the drives at all and gives me the flashing folder. Same thing when I try holding down the option key and use the device manager. Sometimes it will see the drives, and other times it doesn't show anything.
    I have replaced the hard drives, the hard drive cables and the PRAM battery. I am running out of ideas! Anything else that you can suggest would be greatly appreciated.

Maybe you are looking for

  • Preparation for installing bootcamp and windows 7, and in the absence of a DVD drive

    I am not sure that I submitted this with the right boxes ticked, so i am re submitting it! In preparation for installing bootcamp and windows 7, and in the absence of a DVD drive on my MacBook Air, before starting, can I partition my external drive (

  • Urgent: please help me for BADI in CRM

    Hi, Could you please find me the Order check BADI in CRM . Answered will be rewarded . Requirement:- The average weight can be derived from the total weight during order entry by dividing the total weight by number of items. As is done in posting che

  • How to recover from a hung softwareupdate process?

    Hello, This weekend I ran software update via the Server Admin tool on all the nodes in a small cluster of eight Xserves (one master, seven cluster-style nodes). They are all dual processor G4 Xserves with 1 gig of ram, upgrading from 10.4.8 to 10.4.

  • No texting to two people on my contact list

    Today I was unable to send or receive texts from my daughter and granddaughter. They have the same phone (iphone 4s) but on different carrier. I can call out, send and receive texts from others, even call my daughter that cannot receive texts. I cann

  • Mass maintenance of BP

    Hi gurus, I generated BPs by going to DSWP>EDIT>Create Business Partner. I would like to add the communication methods Like E-mail: Email ID against them in a Mass manner. is there any way add the details in a Mass Manner.