Flash Advisor logo
:: Desktop Shortcut
:: Flash Help
Advice from Experts

Closed Thread
Results 1 to 9 of 9
  1. #1

    Default FLV Possitioning Problems

    Hey, I'm not that up on my flash, and this is all new to me with video ect so please bare with me, heh
    Right so far i've made a page with a FLV playing on it, the FLV is in an external Swf file, which contains the controls and video. On the main site i have a square which i've turned into a movie clip and this is where my video should display, whiich is does fine when previewing in flash player, but when i upload it and preview in Safri or IE the video is in the middle of the screen. I've gone over everything and as far as i can tell everythings named right and the actionscript. I thought if it works fine in the Flash player then it would just play fine through the internet.

    Thats the site in full so far, its still got alot to do on it, its big at the moment something like 500k which i'll reduce loads once i get this video working.

    www.ruthlessgravity.co.uk/bhc/main.html

    Head to View trailer. Only the High res is online so far.

    I'm using Flash MX Pro 2004 7.2 if thats any help. Thanks for all the help, much needed!

  2. # ADS
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many
     
  3. #2
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    I only have FlashMX so I havn't played with .flv files much. Post some sample code of how your loading the file into the main flash movie. If it is similar to the loadMovie method, you can use an enterframe event to test the holder clip and size and position the loaded content with the holder, however, never tried it with an .flv file.
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

  4. #3

    Default

    Hey, okay this is the actionscripting thats in the external flash file which contains the Flv.

    var nc:NetConnection = new NetConnection() ;
    nc.connect(null) ;

    var ns:NetStream = new NetStream(nc);

    theVideo.attachVideo(ns);

    ns.play("video.flv");

    rewindButton.onRelease = function() {
    ns.seek(0);
    }

    playButton.onRelease = function() {
    ns.pause();
    }

    var videoInterval = setInterval(videoStatus,100);
    var amountLoaded:Number;
    var duration:Number;

    function videoStatus() {
    amountLoaded = ns.bytesLoaded / ns.bytesTotal;
    loader.loadbar._width = amountLoaded * 255.7;
    loader.scrub._x = ns.time / duration * 255.7;
    }

    ns["onMetaData"] = function(obj) {
    duration = obj.duration;
    }

    var scrubInterval;

    loader.scrub.onPress = function() {
    clearInterval(videoInterval);
    scrubInterval = setInterval(scrubit,10);
    this.startDrag(false,0,this._y,248.4,this._y);
    }

    loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {
    clearInterval(scrubInterval);
    videoInterval = setInterval(videoStatus,100);
    this.stopDrag();
    }

    function scrubit() {
    ns.seek(Math.floor((loader.scrub._x/248.4)*duration));
    }



    Then on the main stage i have;

    lowResBut.onRelease = function() {
    // load in the low res swf
    loadMovie("lowRes.swf", "_root.content");
    };
    midResBut.onRelease = function() {
    // load in the mid res swf
    loadMovie("midRes.swf", "_root.content");
    };
    highResBut.onRelease = function() {
    // load in the high res swf
    loadMovie("highRes.swf", "_root.content");
    };
    // stop the main timeline

    Which is on the buttons.

    Not sure if you can work out whats what from that...

    Thanks

  5. #4
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    Is the target movieclip holder called....."_root.content"? If it is, you can write code that will size and position content being loaded into that movieclip. I have not had a chance to try it with anything other than a .jpg image or .swf movie, but the method goes like this....

    Code:
    _root.onLoad = function() {
    	_root.loaded = true;
    }
    this.onEnterFrame = function() {
    	if (_root.loaded == true) {
    		return;
    	}
    	if (_root.content._width>0) {
    		with (_root.content) {
    //Size and position loaded content
    			_x = 100;
    			_y = 100;
    			_width = 100;
    			_height = 100;
    		}
    		_root.loaded = true;
    		delete this.onEnterFrame;
    	}
    }
    myButton.onRelease = function() {
    	_root.loaded = false;
    	_root.picHolder.loadMovie("someImage.jpg");
    }
    Hope it helps
    NTD
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

  6. #5

    Default

    i tryed the coding but it doesnt seem to work, i'm more than likely doing it wrong.
    Where should I add the code to the main stage or the external flash file?

  7. #6
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    The code sample is frame code and should reside on the first frame of the main timeline. It applies it's actionscript to a movieclip named "content".However, this is a method that is used to size and position a dynamically loaded .jpg image or .swf movie. I am not sure it will work for a .flv file.
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

  8. #7

    Default

    hey thanks so much for helping me out here, the help is greatly apreciated!

    Okay added the actionscript at the start and got this error when previewed.

    **Error** Scene=Scene 1, layer=actions, frame=1:Line 4: Operator '=' must be followed by an operand
    * *_root.loaded = true;

    **Error** Scene=Scene 1, layer=actions, frame=1:Line 5: Unexpected '}' encountered
    }

    Total ActionScript Errors: 2 Reported Errors: 2


    Would it be easyer for me to puit the fla file online for you to download and see for yourself? Again Thanks for the help!

  9. #8
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    I am not sure a demo file will help. I only have FlashMX and can't view FlashMX2004 files. Try pasteing that code onto the first frame of a test movie. Save the movie to a folder that contains a .jpg image or .swf movie and change the image name in the code to match your image or flash movie. Once you see it in action you might find a way to manipulate it to meet your needs.

    NTD
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

  10. #9

    Default

    Hi there!
    I wanna tell about Video to Flash Converter that converts AVI,WMV, VOB, MPEG and other video formats to SWF without quality lossless.It has easy interface and points to HTML source code in order you can display your video on website.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Y coordinate problems
    By Anni in forum Newbies
    Replies: 1
    Last Post: 12-14-2006, 03:06 AM
  2. Navigation problems....
    By Nicky in forum Newbies
    Replies: 1
    Last Post: 05-08-2006, 04:01 AM
  3. LoadVars Problems
    By dkeegh in forum Flash Scripting
    Replies: 1
    Last Post: 03-28-2006, 09:06 PM
  4. Preloader Problems. Help!!!
    By cknick in forum Flash Scripting
    Replies: 1
    Last Post: 11-08-2005, 03:03 PM
  5. URL Problems
    By liqidhed in forum General Flash
    Replies: 1
    Last Post: 06-24-2005, 02:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Sponsors
Create Speaking Characters for your website and Flash movies. 15 Day Free Trial