How would I code to resize my UILoader in SWF

Hi All
I have loaded different SWFs using UI Loader component and I
have used AS 3.0 for that. All those SWFs are playing video in form
of Flvs in that. While executing those UI Loaders show video
efficiently. Is there any way that I can code so that user can also
resize that UI loader and still maintain the aspect ratio of the
video. i am using RESIZE property but it is not allowing the user
to resize the component , it just once resize the component on the
run time
I would highly appreciate any help.
Thanks
Anuj
/* Here's the sample code I am putting to refer*/
var myUILoader:UILoader = new UILoader();
myUILoader.autoLoad = false;
myUILoader.maintainAspectRatio=true;
myUILoader.drawFocus(true);
//Allowing Resize of the UI Loader
/*myUILoader.addEventListener(ComponentEvent.RESIZE,
resizeHandler);
function resizeHandler(event:ComponentEvent):void
var uiLdr:UILoader = event.currentTarget as UILoader;
trace(uiLdr.width, uiLdr.height); // 400 267
uiLdr.move((stage.stageWidth - uiLdr.width) / 2,
(stage.stageHeight - uiLdr.height) / 2);
myUILoader.focusEnabled=true;
myUILoader.scaleContent = true;
myUILoader.width=300;
myUILoader.height=300;
myUILoader.addEventListener(MouseEvent.MOUSE_DOWN,UI1);
myUILoader.addEventListener(MouseEvent.MOUSE_UP,UI2);
function UI1(event:MouseEvent):void
if((myUILoader.x>-887) && (myUILoader.y>-500)
&&(myUILoader.y<746))
myUILoader.startDrag();
else if(myUILoader.y>746)
myUILoader.visible=false;
function UI2(event:MouseEvent):void
if((myUILoader.x>-887) && (myUILoader.y>-500)
&&(myUILoader.y<746))
myUILoader.stopDrag();
else
myUILoader.unload();
myUILoader.source = "/video/pic_1.swf";
myUILoader.load();
myUILoader.move(mouseX,mouseY);
addChild(myUILoader);

Whenever I try to resize an image by clicking "image size" it only resizes the canvas. Before, I could click on a single photo and drag the corner to resize the image. If I pressed shift while I did it, it would retain the same dimension ratios. If I pressed control while I dragged the corner, it would let you manipulate the shape so that you could kind of make it 3D. If you put your cursor in the right place, it would also let you rotate the image. It won't even do any of that when I type text onto my canvas. It seems like that function is turned off, and I'd like to know how to use it again.
Maybe I'm saying it wrong. I guess what I really mean is resizing a layer. Like, if I copy and pasted a photo onto a canvas I already have open, I'd want to drag to resize it to fit the canvas.

Similar Messages

  • How would you code a 3D transform within an mxml?

    How would you code a group of individual text objects, which
    as an associated group, would scroll like the proverbial opening
    Star Wars story description?
    Thanks,
    Pete

    How would you code a group of individual text objects, which
    as an associated group, would scroll like the proverbial opening
    Star Wars story description?
    Thanks,
    Pete

  • How would I code a file upload for in flash?

    The title says it all. Anyone know how I would code a file/pic upload form in flash. I have seen examples that you can use php. However I have tried the php/java I designed for my dreamweaver sites. I think It's time I get with the real designers and us flash for my websites.
    Any imput would be great!

    you can use the filereference class to upload a file using actionscript.  to save the file to your server, you'll need to also use server-side scripting like php.

  • How would this code look in LabVIEW?

    Hello,
    I am new to LabVIEW and I'm hoping that someone can tell me what the code would look like in LabVIEW if I want to do the following.....
    I am using a C dll that has the "acq_get_board_count()" function and so far I am able to get that to work, however I'm having issues with passing the array of clusters from LabVIEW to the C dll
    short count , code;
    MyStruct_board_info *board_info_list;
    count = acq_get_board_count();
    if (count){board_info_list = new MyStruct_board_info[count];
    code = acq_get_board_info(count, board_info_list);
    }else{// no interface card installed}**************************************************​***************************** 
    my C structure looks like the following:
    struct MyStruct_board_info
    char name[32]; 
    short type;
    char en_first_gain; 
    long first_gain_min; 
    char computer_ctrl;
    char pad[3]; 

    One trick I found is to right-click the call library function node and select "create .c file" and examine what it will create.  I used the method that nathand used to generate the cluster using array to cluster to embed the array contents as values.  After you build the array of clusters, I think you will have to pass in element zero.  If you pass in the whole array and look at the c-code, it will still embed a 4-byte size field in the struct and this will whack your dll.
    Use adapt to type in your call library function node.  The pictured code generates the following c-code:
    /* Call Library source file */#include "extcode.h"/* Typedefs */typedef struct { double Array0;double Array1; double Array2;double Array3; double Array4;double Array5; double Array6;double Array7; double Array8;double Array9; double Array10;double Array11; double Array12;double Array13; double Array14;double Array15; double Array16;double Array17; double Array18;double Array19; double Array20;double Array21; double Array22;double Array23; double Array24;double Array25; double Array26;double Array27; double Array28;double Array29; double Array30;double Array31; } TD2;typedef struct { TD2 Array;
    uint32_t Numeric;
    } TD1;void CIELChToDE94(TD1 *arg1);
    Attachments:
    Call dll with cluster.png ‏9 KB

  • How would I go about adding multiple rectangles using the same lines of code?

    How would I go about adding multiple rectangles using the same lines of code? I would prefer to just run through a set of code every time I need a polygon. If I just have to create multiple polygon adding statements that's fine but I'd prefer just 1.

    >>How would I go about adding multiple rectangles using the same lines of code?
    You could create a method that creates and returns x number of Rectangle elements:
    public IEnumerable<Rectangle> CreateRectangles(int numberOfRectsToCreate)
    for (int i = 0; i < numberOfRectsToCreate; ++i)
    Rectangle rect = new Rectangle();
    rect.Fill = Brushes.Blue;
    rect.Width = 100;
    rect.Height = 100;
    yield return rect;
    ..and then call this method from anywhere in your code:
    IEnumerable<Rectangle> rects = CreateRectangles(5);
    foreach (Rectangle rect in rects)
    //add to StackPanel or do whatever with the Rectangle elements:
    yourStackPanel.Children.Add(rect);
    >>If I just have to create multiple polygon adding statements that's fine but I'd prefer just 1.
    When adding Point objects to a Polygon you can only add one per call to the Add method but you could call the Add method inside a loop, e.g:
    for(int i = 0; i < 10; ++i)
    //add to StackPanel or do whatever with the Rectangle elements:
    Polygon p = new Polygon();
    p.Points.Add(new Point());
    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't post several questions in the same thread.

  • Would anyone know how long unlock codes takes when case number is given?

    would anyone know how long unlock codes takes when case number is given?

    Since you get unlock codes from your Mobile provider can take anywhere between 24-72 hours. at most. sometimes longer. Call your provider.

  • How would you write a code to automate this??

    Hi team,
    Still trying to improve my coding..
    So I have got all of these buttons... how would I go about coding so I dont have this function repeated 100 times??
    Cheers,
    Sub
    e.g.
    GSmain.gsshape.gss1.gssr.gssr1.addEventListener(MouseEvent.CLICK, page2go)
    function page2go(e:MouseEvent){
              gotoAndStop(2);
    GSmain.gsshape.gss1.gssr.gssr2.addEventListener(MouseEvent.CLICK, page3go)
    function page3go(e:MouseEvent){
              gotoAndStop(3);
    GSmain.gsshape.gss1.gssr.gssr3.addEventListener(MouseEvent.CLICK, page3go)
    function page3go(e:MouseEvent){
              gotoAndStop(4);
    etc etc

    // loop from 1 to 100
    for(var i:int=1;i<=100;i++){
    // use array notation to coerce flash to convert strings to objects
    GSmain.gsshape.gss1.gssr["gssr"+i].addEventListener(MouseEvent.CLICK, pagego)
    function pagego(e:MouseEvent){
    // gssr1,gssr2,etc are all currentTarget event dispatchers. one of them called this function.  to find which, use the flash string methods.
    // e.currentTarget.name is a string like "gssr1","gssr2",...,"gssr100"
    // the String.substring(n) method returns a substring of String starting at index n.
    // so e.currentTarget.name.substring(4) is "1","2",...,"100" depending on which object was clicked
    // int("n"), converts a string to an int for use in the gotoAndStop() method:
              gotoAndStop(int(e.currentTarget.name.substring(4)));

  • Anyone know how to dynamically change the border of UILoader Component

    Hi All
    I am loading multiple instances of UI loader containing
    external SWFs on my stage. When user double clicks on the video
    thumbnail, an instance of UIloader will be placed on the main
    stage.The user can place as many UIloader instances on the main
    stage. My aim is that if user puts any UIloader on top of already
    existed UIloader, the existed loader will be replaced with the
    placed loader. I am successful in implementing that by using
    hitTestObject method for that. I am planning to provide enough
    feedback to the user for this UIloader replacement process, so i
    was thinking to change the border of the UIloader as soon as the
    dragged UIloader hits the already existed UIloader.
    Does anyone know how would I animate UIloader to give enough
    feedback to the user that it is being replaced. Creating an
    invisible movie and moving it wherever UIloader goes doesn't sound
    much efficient.
    Please help me out in figuring out this problem. Also
    if anyone has better idea to give enough feedback to user, that
    will also be welcome. Just to be little clear i have provided
    little pseudo-code(below) of what i am doing here.
    Any help will be highly appreciated.
    Thanks
    Anuj
    /***************Abstract Pseudo code for my
    problem*****************/
    myUILoader.startDrag();
    //Putting video on top of already existed videos
    var trackChild:Number=container.getChildIndex(myUILoader);
    var childContainer:DisplayObject=
    container.getChildAt(trackChild);
    for( var z:Number=0;z<=container.numChildren-1;z++)
    var restChild:DisplayObject=container.getChildAt(z);
    if(childContainer!=restChild)
    if((childContainer.hitTestObject(restChild))==true)
    //Show Animation during replacement
    //how would i give feedback here
    container.removeChild(restChild);

    What is a Lopp Browser?
    A typo I meant Loop Browser, sorry. On your iPad you can see the iTunes Library in the Loop Browser:
    Open the Loop Browser
    Tap the Loop Browser button in the control bar. The Loop Browser button is available only in Tracks view.The first time you open the Loop Browser, it shows the Instrument grid.
    I was told by a sales person at the Apple Store at one of my One-on-One sessions, that Mac would not transpose nor change tempo because my "live music" was not a "midi" file.
    GarageBand 10.0 will change the pitch and tempo of live recordings - midi as well as audio instruments, but not of audio files. But you need to enable the "Follow tempo and pitch" option in the track editor.
    Then you can transpose the region using the "Transpose" slider.
    And if you change the project tempo in the LED display after you enabled "Follow Tempo&Pitch" the recording will follow the new tempo.
    You can test this with a new project created on your mac.

  • How would I migrate OS 10.6 from my mac mini to my macbook running 10.5 ?

    How would I migrate OS 10.6 from my mac mini to my macbook running 10.5 ?  I eventually want to upgrade to 10.8.  Can I upgrade to 10.8 from 10.6 OS?  I recently purchased an iPhone 5.  I wanna use the iCloud.

    The license you have only covers one computer, and the install disks from one type of Mac will not work on another type. You need to buy another copy of Snow Leopard.
    Start by checking if it can run Snow Leopard:
    Requirements for OS X 10.6 'Snow Leopard'
    http://support.apple.com/kb/SP575
    OS 10.6 Snow Leopard is once again available from the Apple Store:
    http://store.apple.com/us/product/MC573/mac-os-x-106-snow-leopard
    and in the UK:
    http://store.apple.com/uk/product/MC573/mac-os-x-106-snow-leopard
    but nobody knows for how long it will be available.
    To use iCloud you have to upgrade all the way to Mountain Lion:
    http://support.apple.com/kb/HT4759
    You can also purchase the code to use to download Lion (Lion requires an Intel-based Mac with a Core 2 Duo, i3, i5, i7 or Xeon processor and 2GB of RAM, running the latest version of Snow Leopard), or you can purchase Mountain Lion from the App Store - if you can run that:
    http://www.apple.com/osx/specs/
    When you have installed it, run Software Update to download and install the latest updates for Snow Leopard.

  • How would I print information to a DOS window?

    Ok so I can get the DOS window running by using this code:
          try{
                       Runtime rt = Runtime.getRuntime();
                       Process child = rt.exec("cmd.exe /c start cmd.exe");
                       child.waitFor();
                   }catch(IOException io){}
                   catch(InterruptedException e) {}but I want to print the information from this code:
    StringBuffer objectString = new StringBuffer("");
    ////some code here//////
    objectString = new StringBuffer(("Customer:\t\t" + customerName + "\n"
                               + "Departure Date:\t" + departureDate + "\n"
                               + "Return Date:\t" + _returnDate));
    ////some code here/////
    objectString.append("\nAirline:\t\t" + airlineBG.getSelection().getActionCommand());
    objectString.append("\nDestination:\t" + destinationBG.getSelection().getActionCommand());
    /////more code. yay//////
    objectString.append("\nPrice:\t\t" + price);
    objectString.append("\nTicket Bought. Have a safe flight!");
    System.out.print(objectString.toString());//print string bufferso how would I print objectString to the DOS window?
    Note: opening the DOS window is in the constructor for the JFrame I am using while printing the StringBuffer is in the actionPerformed implementation.

    masijade. wrote:
    deadmanwalkin wrote:
    no, the program im supposed to be making asks to print ticket information to a DOS window.
    I might have interpreted it wrong and it could be just start from a DOS window using the java File commandWell, study your assignment text. If it does not explicitly state that you must programmatically open a new "DOS window", then simply print your output using System.out.println().Unless he's running Windows 95 still he can't even open a DOS window as there's no more DOS ;)

  • How would I do this?

    I have to say I'm completely lost. I need to make two files - WordFrequencyAnalyzer.java that has all the functions and TestWordFrequencyAnalyzer.java that should be a GUI that calls the first one. I know how to make GUIs without a problem but its these functions that baffle me.
    This is what I need to do - WordFrequencyAnalyzer.java needs to have a constructor that opens us a text file and reads it and saves what is needed for analysis. This is what I have:
    public void WordFrequencyAnalyzer(String filename) throws IOException
         {//Constructor.  Uses file name to open file reads it, saving what is needed, then closes the file.
               BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(filename))));
         }Now these are killing me:
    public int frequency(String word)
    *****This needs to be able to check the number of times the particular word occurs in the file. How would I do this? Please help give me a clue. The next few seem to tie in together if I could figure out how to do one of them.
    public String mostFrequentWord()
    //The word that occurs most often in the file
    public String[] wordsOccurringAtLeast(int minimumNumberOfTimes)
    //An array, alphabetized, of all the words occurring at least the given minimum number of times...I'd figure I'd use a search and compare method here.
    public int numberOfWords()
    //The number of words (counted once each) in the file
    public String toString()
    //Returns a string which, when printed, will show two columns, with a word on each line on the left and its frequency on the right. The result must be alphabetized.
    Who could give me some pointers. I don't want the code done for me because I need to learn too. Do I need to put the data from the text file into a Collection interface in the java.util package or should I use something else?? And how would I go about doing something like that?
    Thank you very much,
    Henry

    I modified the code above for the Hashtable to a Collection and came up with this and emailed him:
         What about this:
         Collection words = new Collection();
         String line;
         while ((line = br.readLine()) != null)
         StringTokenizer st = new StringTokenizer(line);
         while (st.hasNext())
         { words.add(st.next().toString());
         Storing in a Collection is what you want right? I don't want to do something that you don't approve of. I remember the time I used a Hashtable and you didn't like it. ...
    This is his response:
    As for your suggested solution: A collection is a good idea, but Collection is
    an interface, so you can't do anything like
    Collection words = new Collection();
    You must figure out what kind of collection to use. And here's a hint about
    something else:
    If every time you see a word like "the" you store it in the collection, you'll
    have two problems: the word will be stored over and over, which is inefficient
    use of space, and your program will have to do a lot of repetitive work to
    implement the methods, which is inefficient use of time.
    I new he wanted a Collection. I'm starting to know him a little better now I guess, which still doesn't help as much. If anyone has any ideas please post - this is all new to me. Does anyone know the best kind of Collection to use as he put it?
    Thanks,
    Henry

  • Good afternoon. I have created a Form in Indesign, imported into FormsCentral. I would like to post this onto a webpage. It is currently an iPDF. How would I go about doing this. I cannot 'Place it'. Thanks

    Good afternoon.
    I have created a Form in Indesign, imported into FormsCentral.
    I would like to post this onto a webpage. It is currently an iPDF.
    How would I go about doing this. I cannot 'Place it'.
    Thanks

    The only way to use Forms Central would be to export it the method that gives you the embed code (can't remember what the actual term is off hand) and then use Object--->Insert HTML and past your code in.

  • How to get code from standard built-in

    How to get code from standard built-in

    I would recomend to copy all includes you need into your program.
    But if it is not possible for some reason,
    PERFORM <formname> IN PROGRAM <progname>
    can help you.
    I hope it helps
    Vlado

  • How would i edit an exsisting program so it has......

    How would i edit an exsisting java program so it has a sort of automate "marco" feature inside of it? Can any one give me any exsamples of some code that might help me?

    ok i have decompiled this game runescape "that is programmed in java" well i have at least decompiled the internet client thingy. and i want to create a macro for the game. i just need some code to insert into the program then i can recompile it so i can play/cheat the game..... was that clear enough?

  • How would you go about limiting file upload

    I don't need source code, just want to know if it's possible or how to go about limiting how many files a user can upload.
    So far
    I can limit what types of files get uploaded.
    I can limit how big those files can be.
    Is it possible, or how would you go about limiting how many files get sent?
    - When the user does a browse they can select multiple files.

    This is the best that I can come up with.
    Ripped from adobe cookbooks
    var fileList:Array = fileReferenceList.fileList;
    if( fileList.length > 4 )
        Alert.show("Too many files" , "Please try again with 4 or less files");
    else
       for (var i:Number=0; i<fileList.length; i++)
           var file:FileReference = FileReference(fileList[i]);
           arrayCollection.addItem({name:file.name, size:file.size, object:file})
    If this post was helpful , please mark it as such.

Maybe you are looking for