Dynamically loading jpg files

Scenario: we have a button to view special events on our
website. these events change on a regular basis.
Issue: I want our adminstrative assistants (no flash
knowledge) to be able to upload a jpg (which has all the info for
the event on it) to the site and have flash take it and update the
"special events page".
Work so far: I have this working using the following code:
specialEmpty_mc.createEmptyMovieClip("specialPicture_mc",
3);
specialEmpty_mc.specialPicture_mc._x=66;
specialEmpty_mc.specialPicture_mc._y=163;
specialEmpty_mc.specialPicture_mc.loadMovie("special-event/special.jpg");
Now I want to get fancy. I need to have "TWO" jpg files
alternate back and forth in the loop. Preferrably crossfading using
alpha in motion tweens.
For the life of me, I can't get my mind around how to do
this. Help?
tom hereford

Wow this is fantastic. This is a bit above my comprehension
though. can you explain the setInterval line you have here? I
looked at the actionscript dictionary and got this:
setInterval( object , methodName , interval )
How does this work with
fadeI=setInterval(fadeF,50,num);
I guess I need a little more comment to understand this
better.

Similar Messages

  • How to dynamically load jar files - limiting scope to that thread

    Dynamically loading jar files has been discussed a lot. I have read a quite a few posts, articles, and demo code for doing just that. However, I have yet to find a solution to my problem. Most people modify their system class loader and are happy. I have done that and was happy for a time. Occasionally, you will see reference to an application server or tomcat or some other large project that have successfully been able to load and unload jar files, allow for dynamic deployment of code, etc. However, I have not been able to achieve similar success; And my problem is much less complicated.
    I have an application that executes a thread to send a given file/message to a standard JMS Server Queue. Depending on the parameters selected by the user, this thread may need to communicate with one of a number of JMS Servers, ie. JBoss, WebLogic, EAServer, Glassfish, etc. All of which can be done with the same code, but each needs to load their own flavor of JMS Client Jar files. In this instance, spawning a separate JVM for each communication would work from a classloader perspective. However, I need to keep it in the family and run under the same JVM, albeit each JMS Server Connection will be created and maintained in separate Threads.
    I am close, I am doing the following...
    1. Creating a new URLClassLoader in the run() method of each thread.
    2. Set this threads contextClassLoader to the new URLClassLoader.
    3. Load the javax.jms.JMSException class with the URLClassLoader.loadClass() method.
    4. Create an initialContext object within this thread.
    Note: I read that the initialContext and subsequent conext lookup calls would use the Thread�s
    contextClassLoader for finding/loading classes.
    5. Perform context.lookup calls for a connectionFactory and Queue name.
    6. Create JMS Connection, etc. Send Message.
    Most of this seems to work. However, I am still getting a NoClassDefFoundError exception for the javax.jms.JMSException class ( Note step #3 - tried to cure unsuccessfully).
    If I include one of the JMS Client jar files ( ie wljmsclient.jar for weblogic ) in the classpath then it works for all the different JMS Servers, but I do not have confidence that each of the providers implemented these classes that now resolve the same way. It may work for now, but, I believe I am just lucky.
    Can anyone shine some light on this for me and all the others who have wanted to dynamically load classes/jar files on a per Thread basis?

    Thanks to everyone - I got it working!
    First, BenSchulz' s dumpClassLoader() method helped me to visualize the classLoader hierarchy. I am still not completely sure I understand why my initial class was always found by the systemClassLoader, but knowning that - was the step I needed to find the solution.
    Second, kdgregory suggested that I use a "glue class". I thought that I already was using a "glue class" because I did not have any JMSClient specific classes exposed to the rest of the application. They were all handled by my QueueAdmin class. However...
    The real problem turned out to be that my two isolating classes (the parent "MessageSender", and the child "QueueAdmin") were contained within the same jar file that was included in the classpath. This meant that no matter what I did the classes were loaded by the systemClassLoader. Isolating them in classes was just the first step. I had to remove them from my jar file and create another jar file just for those JMSClient specific classes. Then this jar file was only included int custom classLoader that I created when I wanted to instantiate a JMSClient session.
    I had to create an interface in the primary jar file that could be loaded by the systemClassLoader to provide the stubs for the individual methods that I needed to call in the MessageSender/QueueAdmin Classes. These JMSClient specific classes had to implement the interface so as to provide a relationship between the systemClassLoader classes and the custom classLoader classes.
    Finally, when I loaded and instantiated the JMSClient specific classes with the custom classLoader I had to cast them to the interface class in order to make the method calls necessary to send the messages to the individual JMS Servers.
    psuedu code/concept ....
    Primary Jar File   -  Included in ClassPath                                                      
    Class<?> cls = ClassLoader.loadClass( "JMSClient.MessageSender" )
    JMSClientInterface jmsClient = (JMSClientInterface) cls.newInstance()                            
    jmsClient.sendMessage()                                                                      
    JMSClient Jar File  -  Loaded by Custom ClassLoader Only
    MessageSender impliments Primary.JMSClientInterface{
        sendMessage() {
            Class<?> cls=ClassLoader.loadClass( "JMSClient.QueueAdmin" )
            QueueAdmin queueAdmin=(QueueAdmin) cls.newInstance()
            queueAdmin.JMSClientSpecificMethod()
        }

  • Cannot Load JPG Files From Canon Powershot S2 IS

    Hi,
    I'm having a problem loading JPG files from my Canon Powershot S2 IS. When I plug the camera into the USB port, I get the Canon Camera/DV Twain Driver with a list of images to import. They are all JPEG images, which is my camera's native format. (I don't think RAW is available on this model.) But when I select an image by double-clicking it, it is imported into Photoshop Album (Starter Edition 3.0), but has somehow been converted to TIFF.
    The problem I have with this is that the TIFF format uses up about 7 time more disk space than the original JPG and I can't afford a new hard drive right now. I simply don't have enough disk space available to import all my images. (I plan to back them up on CD after importing.)
    I see that Edit -> Preferences -> Scanner has an option to save files as JPEG, but Edit -> Preferences -> Camera has no such option.
    Please help! How do I get the images to stay as JPEG?
    Thanks!
    Debbie Hunt

    Answered your other post
    Colin Walls, "Help! PSA SE 3.0 converts my images to TIFF!" #1, 9 Sep 2005 2:28 pm

  • Dynamically loading jar files

    Hi
    In my application I need to dynamically create objects of types specified by string which is passed as parameter. I am able to do this if the class is inside the same jar. But I need to load the class from any jar name specified. How do i go about doing this? Is there a way to dynamically loading jar files?

    It's easy. You use [url http://java.sun.com/j2se/1.5.0/docs/api/java/net/URLClassLoader.html]URLClassLoader:String jarPath = ...;
    String className = ...;
    URLClassLoader ucl = new URLClassLoader(new URL[] { new File(jarPath).toURL() });
    Class cls = Class.forName(className, true, ucl);
    ...Regards

  • Load jpg Files in to the Report

    Hello,
    I would like to load a *jpg file in to the Diadem Report. I can load the pictures by going to "Diadem Report->Graphics-> load Graphics". But I have to do it by the VSB Script automatically. Unfortunately I couldnt finde any VBS-Code how to do it.
    Doese anyone has any idea how to do it?
    Thanks

    Hello FHM!
    If you use DIAdem 10 or better there is another aproach: Use an expression like '@T1@' as filename in the report and just set the variable to your image filename und call 'PicUpdate'. The advanced user can use an expression like '@@MyCmdExtFunc@@' as filename to implement a dynamic call to an user command extension script function on every 'PicUpdate'.
    Matthias
    Matthias Alleweldt
    Project Engineer / Projektingenieur
    Twigeater?  

  • Including dynamically generated jpg files in a report in PDF

    Hi all,
    hope I'm in the right forum.
    We have an issue with images we must include in a report, when the report output format is PDF.
    We are using these versions for Reports etc... :
    Report Builder 10.1.2.0.2
    ORACLE Server Release 10.1.0.4.2
    Oracle Procedure Builder 10.1.2.0.2
    Oracle ORACLE PL/SQL V10.1.0.4.2 - Production
    Oracle CORE    10.1.0.4.0    Production
    We need to include in a report a image (jpg or png) which is provided (and created dynamically) by NWA Quality Analyst.
    We use a BoilerPlate Field, and in the hyperlink property, we have something like  :
    http://myserver/XBAR_GRAPH.NWG?CachedFile=something,etc.><IMG SRC="http://myserver/XBAR_GRAPH.jpg?CachedFile=....
    Works fine when getting the report in HTML output format.
    But doesn't work when the report is in PDF output format. Seems to be a security constraint of PDF.
    Question 1 : Has anybody already faced a similar issue ? And solved it ?
    We tried to include a jpg file located anywhere on our server, it works fine, BUT in our case, the jpg file returned by NWA Quality Analyst is not stored anywhere (generated on the fly)
    Question 2 : is there a way, in PL-SQL (in beforereport trigger) to call the URL, get the file returned and save it somewhere ?  Or display it as a image ?
    Thanks for any idea and help effort.
    (French translation available on demand as my english is not so good ;-)

    Hi all,
    we found a solution for our issue :
    we generate the png file from the QA server using UTL_HHTP package, with a defined name.
    Then we get this image in our report,  in PDF format output.
    May this help...
    If you got question...

  • Flash actionscript loads jpg files, no png or gif

    Hi, I'm using this script to load png files, but it does not
    load them, it loads jpgs. It is being pulled from an xml file. I
    have also tried gifs and that does not work. I need to put images
    that have transparency. I can not find any refrence to jpg in the
    code or anything like that. Any ideas would be helpful.
    code:
    Thanks,
    Josh

    Hi, I'm using this script to load png files, but it does not
    load them, it loads jpgs. It is being pulled from an xml file. I
    have also tried gifs and that does not work. I need to put images
    that have transparency. I can not find any refrence to jpg in the
    code or anything like that. Any ideas would be helpful.
    code:
    Thanks,
    Josh

  • I can not load jpg. files or pdf into Id.

    I have already dealt with my schools IT and they were unable to assist. After not being able to load these files into Id cs6, I went to CC and still no luck.

    Update to previous post... when attempting to push file into Adobe Id  I get this response, (Cannot open file "_____" Adobe Id may not support the file format, a plug-in that supports the file format may be missing, or the file may be open in another application.) I have searched for updates several times, and CC and CS6 both are up to date. I have tried opening numerous files that are both jpg. and psd. none of them even ones that previously were opened in Id, and no luck.

  • Dynamically loading help file from standalone application

    Hello All;
    I have written into my VI an option to load a help file (.chm) from my main application using the 'Open URL in Default Browser.VI'.  When I am in Development Mode, this works perfectly.  However, after I have compiled my VIs into an executable, this no longer works (i.e. nothing loads).  I am wondering if since the CHM file is not a default LabVIEW VI/LLB if this is where my problem is?  I have attached a BMP which shouls what I am doing.
    I did manage to get the CHM file to install with my application, but as mentioned, it will not load.  I have also attached a bitmap showing my build properties for this.
    Any assistance would be greatly appreciated.  Thanks.
    DJH
    Attachments:
    Loading CHM Files.zip ‏28 KB

    The change required for path information is really not all that hard to understand. If you use something like Current VI's Path, it will return c:\folder\example.vi. When an exe is created, each VI is put into the exe which is really a type of llb file. To prove this, just change the extension to llb and you can view the contents just like like any other llb file. Then the Current VI's Path will return c:\folder\application.exe\example.vi. So, the extra strip path is required to get the folder name. Using the application property App.Kind in your program allows the same program to work in the development mode ans as an exe. It would be difficult for the app builder to automatically add a strip path because it be next to impossible to know what the purpose of the Current VI's Path function is intended by the programmer. You can also simulate the behavior of the app builder by creating an llb and testing all of your path's there before doing the build. Also, by default, the app builder does create a \Data folder but when you do the build, you can change where certain files get installed to.
    Message Edited by Dennis Knutson on 05-22-2006 08:44 AM
    Attachments:
    Strip Path.JPG ‏10 KB

  • HELP!! NEWBIE - Dynamically load jpg images - NEWBIE Question.

    Newbie here.
    Im currently making a flash website. and trying to make it as light as possible.
    so decided to load images dynamically.
    Im using UILoaders.
    I drag the UILoader from components into the main timeline and set the source as 1.jpg, because the image is in the same folder as the .fla file.
    and scale - false
    Tested the movie but nothing shows up. i guess i need some coding? but i dont know where to add the codes. on the same frame? or in frame 1?
    i also need the image to fade-in.
    the end result im looking for is, as i click a button. 3 images show up at the same time, fading in.
    Help, greatly appreciated.
    and thanks in advance

    thanks your the reply,
    the source is set to 1.jpg i put a image file named 1.jpg into the same as the fla. and swf and everything.
    the UILoader is visible in frame 55 or so. and as i click a button the pic is suppose to show , but it doesnt??
    the jpg is also non-progressive..
    any idea why its not working?

  • Cue points in dynamically loaded flv file through netstream

    How can i add cue points to a playlist of flv files which are
    loaded dynamically through an xml files. All the sources i have
    found over the internet are using flvplayback control :(

    Lestyn, thanks for the verification.  Took me a frantic 4 hours to arrive at the same conclusion.  Do these people test their software???
    Maddening.

  • Problems with Dynamically Loaded jpgs

    Hello all,
    I'm trying to create a dynamic flash slideshow that loads
    external jpgs (and thus can be reused). I can get my jpgs to load
    just fine but when I try to center the loaded images I run into
    problems.
    Here is my code for reference:
    quote:
    _root.createEmptyMovieClip("parentClip", 1);
    parentClip.createEmptyMovieClip("containerClip", 1);
    parentClip.containerClip.loadMovie("images/tempSlideshowImages/image2.jpg");
    When I go to get the width or height of parentClip (or
    containerClip for that matter) I get 0 no matter what I do, even
    though the image is loaded and displays just fine.
    Is there any way to load a jpg into a movie clip and then
    manipulate the movieclip normally?

    Use the MovieClipLoader class, and then use its onLoadInit
    callback to set
    your properties once the clip is available to manipulate.
    Dave -
    Adobe Community Expert
    www.blurredistinction.com
    http://www.adobe.com/communities/experts/

  • Dynamically load jar file

    Hi,
    I've got an applet (used in a website) which must internally load a jar (the jarname and mainclassname are stored in the database).
    with a lot of jars (more than 10) and slow-internet users of my applet, it is not an option to add all the jars to the archive-parameter within the applet:
    <APPLET
         CODE="my.mainClass.class"
         width="800"
         height="600"
         archive = "MyMainJar.jar,someOther.jar, another.jar, andAgain.jar, lastExample.jar"
         codebase="/javaclasses"
    >
    So, adding all the jars is not an option, because if a class of the last jar (in this example: lastExample.jar) is needed, all the other jars must be loaded first.
    I have tried it with a classloader, to load the jar, but i've got an AccessControlException:
    java.security.AccessControlException: access denied (java.lang.RuntimePermission createClassLoader)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkCreateClassLoader(Unknown Source)
         at java.lang.ClassLoader.<init>(Unknown Source)
    The question is: how can I dynamically (in an applet) open a jar, and create an instance of a class in that jar?
    I searched the internet, but google can't help me out.
    Regards,
    Thijs

    It shouldn't be that difficult; all the stuff you need to build jars is in java.util.jar.*.
    Essentially it's back to combining the jars you need into one big one, give a different name to each of the different combinations you might need. You'd probably have the composite jars stored, but when one was requested it would check the dates of the component jars and rebuild if needed.

  • LabView 8.20 MathScript Dynamic Loading

    Does anyone know if LabView 8.20 MathScript supports dynamically loading m-files? I would like to be able to be prompted for a path to an m-file, choose the m-file and have LabView compile and run the script.
    For the sake of this question, lets say that I am adhering to some "function prototype", assuring that my loaded m-file has input and output variables that match those set up on my MathScript node.

    Your particular use case is very interesting as we have been thinking a lot about it lately.  There is no really easy way to do what you wish.  Could you describe your application a bit more?  Perhaps we can discover a better solution.
    You mention that you won't know the functions that will be used in advance.  Unfortunately, this will have some performance implications because any new script will need to be compiled before it can execute.  If you did know the functions you were going to call, you could use some if or switch logic to implement a selector to choose among the different m-files.
    It isn't possible to place the script into a MathScript node when the VI is running.  Instead, what you'll want to do is bring up the file dialog for the user to choose a file.  You can then use LabVIEW's Strip Path primitive to separate the path from the m-filename.  You will also want to remove the .m extension from the filename so you just have the function name.  You can pass the path and the function name into a MathScript Node that has all the other inputs and outputs configured per the common prototype.  Simply call the 'path' function in MathScript to set the value you passed in to be the current path.  Then, build a string by concatenating the output variables with the function name and the input parameters, e.g.
    str = ['a = ' func_name '(x, y, z)']
    With the path set, MathScript will be able to locate the function you are calling.  To execute the function, use the 'eval' command.  The 'eval' command also takes a slight performance hit in order to evaluate the string.  If you also wanted to require that all functions have the same name (so that they are only differentiated by their location on the filesystem), you could improve performance slightly.  By naming all the functions 'fname,' you could replace the string concatenation and eval call with a simple call to the function, .e.g.
    a = fname(x, y, z)
    and MathScript would use the function found in the current path.
    Please let me know if you have further questions.
    Grant M.
    Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments

  • How to manage variables in dynamically loaded sequence

    Variables in dynamically loaded sequence files are not managed properly.
    Steps to reproduce:
    1. Unpack attached zip file
    2. Launch TestStand Sequence Editor
    3. Add directory of unpacked files to Search Directories list (Configure>>Search Directories...)
    4. Set Station Model to unpacked "UpdatedSequentialModel.seq" (Configure>>Station Options...; Model tab in TestStand Sequence Editor)
    5. Load unpacked "A.seq" sequence file  (File>>Open Sequence File.. in TestStand Sequence Editor)
    6. Check "Execute>>Break on First Step"
    7. Run "Test UUTs"
    8. When execution breaks, note the following:
    a) "Locals.SomeVar" contain "The value, which stored in the file" instead of "New value"
    b) Although actual running sequence file is "B.seq", the tab title is: "Test UUTs - A.seq"
    Try also:
    1. To examine "RunState.ProcessModelClient.Data.Seq["MainSequence"].Locals.SomeVar" variable, when breakpoint is set at <End Group> of PreUUT of Station Model "UpdatedSequentialModel.seq".
    2. Open unpacked "B.seq" sequence file in TestStand Sequence Editor and repeat all the checks
    Additional info:
    1. I use TestStand 4.0.0.326
    2. Attached Process Model file "UpdatedSequentialModel.seq" is original "SequentialModel.seq" with only one step "UpdateClientSequence" added in PreUUT.
    3. The source of mentioned above new added step is attached as well.
    thanks.misha
    Attachments:
    UpdateClientSequence1.zip ‏135 KB

    Kristen,
    "Why I architect "My application" this way?"
    "My application" is intended to serve significant amount of test stations and products. Each product is represented by its own test sequence file.
    "My application" and client sequence files are independent products. Client sequence files are responsible for products testing, while "My application" is responsible for common tasks.
    Process Model is most pertinent place to perform common tasks (common for all test stations and for all products).
    Providing supplemental sequence file just to perform SequenceCall, is completely unnatural.
    Moreover, if using SequenceCall, I see no way to update local variables of new launched sequence file, before it starts to execute (step 5 of "Message 3 of 4").
    Thus, the solution, which you propose, cannot satisfy our factory requirements.
    Back to my questions.
    1. Is something wrong with the way, which I implement the task?
    2. Is it possible to implement my task using NI TestStand?
    3. Is my problem caused by incorrect usage of "edit copy" and "runtime copy" of the variable? TestStandReferenceManual says:
    "Built-in properties of steps and sequences are flagged to be shared at run time. For these shared properties, TestStand does not create a unique run-time copy, but instead references the edit-time copy. Any changes to the run-time reference of these built-in properties edits the original Step or Sequence object in the sequence file."
    The variable, which we discussing is not Built-in property.
    4. If previous correct, how differentiate between "edit copy" and "runtime copy" of the variable?
    thanks.misha
    Message Edited by mishaw on 06-05-2008 07:17 AM

Maybe you are looking for

  • How do I use a new account to download a new trial???

    How do I use a new account to download a new trial???

  • Process to install Windows 7 ???

    What is the process to install Windows 7 on a MBP? Bootcamp ---  Windows -- Parallels ? Is this the order?

  • Need a help on Update statement

    Hi All, I Need a help in updating a table column. PFB my requirement. Table1 ItemID OrgId       Date 1       82     12/sep/2012    2       82     25/oct/2012 3       82     17/Nov/2012 4     82     22/Jan/2013 5     82     26/sep/2012 Table2 Itemid  

  • Different galleries web

    Hello to all I have a doubt. hope that someone can help. It is about iPhoto + .Mac ¿Can be created different galleries web (of iPhoto)? I need two galleries web. Thanks Sorry for my bad english.

  • Help on JtabbedPane and JFrame

    Hi everyone, i am self studying java and I am following tutorials I got from Sun developer (the Divelog application). However, i can't figure out the following problem: 1. The field DiveLog.dllframe is never read locally 2. The field DiveLog.tabbedPa