Action Script Help (Flash 8 ONLY)

My department currently has a host of training videos we use
for online courses. Of course, these are all being delivered as
FLVs. Through the Developer's communities, I found a script that
allowed me to add a caption file to the video (XML).
Now I'd like to take it to another level. I'd like to be able
to have my one SWF player play a series of FLVs AND include the
caption file. I began to look at using an Array, but have not been
successful in making it work. I'm not too sure, but I think the way
I coded it started to affect the video - started getting "stuck" at
times. Another attempt caused the caption file from the previous to
be seen in the current video.
I have attached my script and would appreciate any
assistance.
Finally, I need to stick to a Flash 8 and Action Script 2.0
solution. I realize that Flash 9 and Action Script 3.0 would be
helpful, but our district PCs are all imaged with a Flash 8 player.
Sorry.
Thank you for your help.
Frank Erazo ([email protected])

Whatever approach you take will depend heavily on the document(s) you have for the bible element of the design.  You somehow need to be able to seek within it and determine where matched elements can be found and how to extract the information you intend to present.
I don't think your issue currently lies with how to do this in Flash as much as first coming up with a gameplan that identifies the players and how you can interact with and within them.

Similar Messages

  • Flv xml Stream Playlist action script help

    So if you go to this site:
    click here
    you will see a FLV player that has a list of videos that are
    pulled from a .xml file...
    The action script for this player is as such:
    var nc:NetConnection = new NetConnection();
    nc.connect(null);
    var ns:NetStream = new NetStream(nc);
    theVideo.attachVideo(ns);
    rewindButton.onRelease = function() {
    ns.seek(0);
    playButton.onRelease = function() {
    ns.pause();
    var videoInterval = setInterval(videoStatus,100);
    var amountLoaded:Number;
    var duration:Number;
    ns["onMetaData"] = function(obj) {
    duration = obj.duration;
    function videoStatus() {
    amountLoaded = ns.bytesLoaded / ns.bytesTotal;
    loader.loadBar._width = amountLoaded * 194.5;
    loader.scrub._x = ns.time / duration * 194.5;
    var vlist:XML = new XML();
    vlist.ignoreWhite = true;
    vlist.onLoad = function() {
    var videos:Array = this.firstChild.childNodes;
    for(i=0;i<videos.length;i++) {
    videoList.addItem(videos
    .attributes.desc,videos.attributes.url);
    ns.play(videoList.getItemAt(0).data);
    videoList.selectedIndex = 0;
    var vidList:Object = new Object();
    vidList.change = function() {
    ns.play(videoList.getItemAt(videoList.selectedIndex).data);
    videoList.addEventListener("change",vidList);
    vlist.load("videos.xml");
    I want to action script something that will make the videos
    play one after the other, get rid of the list on the right and have
    buttons on player that allow you to go to the next/previous video
    listed in the .xml file
    Its sort of like the player at
    click
    here
    I know this is a lot to ask, but I am currently in a jam and
    any help would be greatly appreciated...
    Thanks
    Matthelm88

    gotoAndLearn is a fantastic base to build off of.
    but
    i'm looking for the same thing... how do you get the files
    to play one after another?
    i've looked for everyhting ns. related and i can find any
    doc's on this one.
    i 've found the
    function complete_listener(eventObject:VideoEvent):void {
    if (my_FLVPlybk.source == "rentv1.flv") {
    my_FLVPlybk.play("rentv2.flv");
    else if (my_FLVPlybk.source == "rentv2.flv") {
    my_FLVPlybk.play("rentv3.flv");
    on the flash video live docs.. but i can't find anything on
    how to tie it into the XML.
    anything anyone can offer would be a huge help ...

  • XML Action Script Help

    Im taking over a job and I was given the original flash file
    that doesnt seem to be working properly.
    It a thumbnail menu that loads through xml...the images work
    fine but the Links & Titles do not load.
    Nor does the rollover effect. Here what I have.
    Action Script:
    Stage.align = "TL";
    Stage.scaleMode = "noscale";
    preloader._visible = true;
    thumbs_line._visible = false;
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    my_xml = new XML();
    my_xml.ignoreWhite = true;
    if (_parent.xml_file == undefined) {
    my_xml.load((String(_url.slice(0, (_url.length-3))))+"xml");
    } else {
    my_xml.load(_parent.xml_file);
    my_xml.onLoad = function(ok) {
    if (ok) {
    process_xml();
    } else {
    trace("XML not loaded");
    function process_xml() {
    total_images = my_xml.childNodes[1].childNodes.length-1;
    gallery_width =
    Number(my_xml.childNodes[0].childNodes[0].attributes.gallery_width);
    gallery_height =
    Number(my_xml.childNodes[0].childNodes[0].attributes.gallery_height);
    max_thumb_height =
    Number(my_xml.childNodes[0].childNodes[0].attributes.max_thumb_height);
    thumbs_space =
    Number(my_xml.childNodes[0].childNodes[1].attributes.thumbs_space);
    thumb_border =
    Number(my_xml.childNodes[0].childNodes[1].attributes.thumb_border);
    image_border =
    Number(my_xml.childNodes[0].childNodes[1].attributes.image_border);
    fade_in_seconds =
    Number(my_xml.childNodes[0].childNodes[2].attributes.fade_in_seconds);
    fade_out_seconds =
    Number(my_xml.childNodes[0].childNodes[2].attributes.fade_out_seconds);
    thumb_fade_seconds =
    Number(my_xml.childNodes[0].childNodes[2].attributes.thumb_fade_seconds);
    fade_in_seconds += 0.01;
    fade_out_seconds += 0.01;
    thumb_fade_seconds += 0.01;
    thumbs_line._y =
    gallery_height-max_thumb_height-(4*thumbs_space);
    thumbs_line.thumbs_bg._width = gallery_width;
    thumbs_line.thumbs_mask._width = gallery_width;
    thumbs_line.thumbs_bg._height =
    max_thumb_height+thumbs_space*2+thumb_border*2;
    thumbs_line.thumbs_mask._height =
    max_thumb_height+thumbs_space*2+thumb_border*2;
    thumbs_line._visible = true;
    load_thumb(0);
    preloader._x = int((gallery_width-preloader._width)/2);
    preloader._y = int(thumbs_line._y/2-preloader._height/2);
    max_image_height =
    gallery_height-max_thumb_height-thumbs_space*6;
    load_image(0);
    this["link"+t] =
    my_xml.childNodes[1].childNodes[t].attributes.link;
    function load_thumb(t) {
    thumbs_line.thumbs.createEmptyMovieClip('thumb'+t,
    thumbs_line.thumbs.getNextHighestDepth());
    thumbs_line.thumbs['thumb'+t]._y =
    thumbs_space+thumb_border;
    thumbs_line.thumbs['thumb'+t]._x =
    thumbs_space+thumb_border;
    if (t>0) {
    thumbs_line.thumbs['thumb'+t]._x =
    thumbs_line.thumbs['thumb'+(t-1)]._x+thumbs_line.thumbs['thumb'+(t-1)]._width+thumbs_spac e;
    thumbs_line.thumbs['thumb'+t].image_number = t;
    thumbs_line.thumbs['thumb'+t].onRollOver =
    thumbs_line.thumbs['thumb'+t].attachMovie("thumbov_mc",
    "thumbov_mc", 10);
    thumbs_line.thumbs['thumb'+t].onRelease = function() {
    tellTarget (thumbs_line.thumbs['thumb'+t]) {
    var loadListener:Object = new Object();
    loadListener.onLoadInit = function(target_mc:MovieClip) {
    preloader.visible = false;
    thumbs_line.thumbs['thumb'+t].attachMovie("border_grey",
    "border_grey", 10);
    thumbs_line.thumbs['thumb'+t].border_grey._x -=
    thumb_border;
    thumbs_line.thumbs['thumb'+t].border_grey._y -=
    thumb_border;
    thumbs_line.thumbs['thumb'+t].attachMovie("border_white",
    "border_white", 20);
    thumbs_line.thumbs['thumb'+t].border_white._x -=
    thumb_border-1;
    thumbs_line.thumbs['thumb'+t].border_white._y -=
    thumb_border-1;
    if (target_mc._height>max_thumb_height) {
    ratio = target_mc._width/target_mc._height;
    target_mc._height = max_thumb_height;
    target_mc._width = int(target_mc._height*ratio);
    thumbs_line.thumbs['thumb'+t].border_grey._width =
    target_mc._width+thumb_border*2;
    thumbs_line.thumbs['thumb'+t].border_grey._height =
    target_mc._height+thumb_border*2;
    thumbs_line.thumbs['thumb'+t].border_white._width =
    target_mc._width+thumb_border*2-2;
    thumbs_line.thumbs['thumb'+t].border_white._height =
    target_mc._height+thumb_border*2-2;
    if (t<total_images) {
    t++;
    load_thumb(t);
    thumbs_width = thumbs_line.thumbs._width;
    thumbs_right_limit = 0;
    thumbs_left_limit =
    0-thumbs_width+int(gallery_width-thumbs_space-thumbs_space);
    var thumb_fade_in:Tween = new Tween(target_mc, "_alpha",
    none.easeIn, 0, 100, thumb_fade_seconds, true);
    var thumb_loader:MovieClipLoader = new MovieClipLoader();
    thumb_loader.addListener(loadListener);
    createEmptyMovieClip("img", 30);
    thumb_loader.loadClip(this.my_xml.childNodes[1].childNodes[t].attributes.small,
    img);
    thumbs_line.onMouseMove = function() {
    if (_xmouse>=thumbs_line.thumbs_bg._x and
    _xmouse<=thumbs_line.thumbs_bg._width and
    _ymouse>=thumbs_line._y and
    _ymouse<=thumbs_line._y+thumbs_line._height) {
    onRollOver =
    thumbs_line.thumbs['thumb'+t].attachMovie("thumbov_mc",
    "thumbov_mc", 10);
    onEnterFrame = function () {
    if (_xmouse<(gallery_width/2)-10 and
    thumbs_line.thumbs._x<thumbs_right_limit) {
    thumbs_line.thumbs._x -=
    int((_xmouse-thumbs_line.thumbs_bg._width/2)/(100-scroll_speed));
    if (thumbs_line.thumbs._x>thumbs_right_limit) {
    thumbs_line.thumbs._x = thumbs_right_limit;
    if (_xmouse>gallery_width/2+10 and
    thumbs_line.thumbs._x>thumbs_left_limit) {
    thumbs_line.thumbs._x -=
    int((_xmouse-thumbs_line.thumbs_bg._width/2)/(100-scroll_speed));
    if (thumbs_line.thumbs._x<thumbs_left_limit) {
    thumbs_line.thumbs._x = thumbs_left_limit;
    } else {
    onEnterFrame = undefined;
    this["link"+t] =
    my_xml.childNodes[1].childNodes[t].attributes.link;
    this["the_target"+t] =
    my_xml.childNodes[1].childNodes[t].attributes.target;
    XML File
    <?xml version="1.0" encoding= "UTF-8" ?>
    <options>
    <option gallery_width="730" gallery_height="450"
    max_thumb_height="96"/>
    <option scroll_speed="75" thumbs_space="0"
    thumb_border="1" image_border="2"/>
    <option fade_in_seconds="1.5"
    thumb_fade_seconds="1.5"/>
    </options>
    <gallery>
    <img small="../flash/hosts/images/pic7.jpg" title="Name
    1" link="hosts.asp"/>
    <img small="../flash/hosts/images/pic1.jpg" title="Name
    2" link="bio1.asp"/>
    <img small="../flash/hosts/images/pic2.jpg" title="Name
    3" link="bio2.asp"/>
    <img small="../flash/hosts/images/pic3.jpg" title="Name
    4" link="bio3.asp"/>
    <img small="../flash/hosts/images/pic5.jpg" title="Name
    5" link="bio4.asp"/>
    <img small="../flash/hosts/images/pic6.jpg" title="Name
    6" link="bio5.asp"/>
    <img small="../flash/hosts/images/pic8.jpg" title="Name
    7" link="bio6.asp"/>
    <img small="../flash/hosts/images/pic9.jpg" title="Name
    8" link="bio7.asp"/>
    </gallery>
    Thier is a dynamic Text field in the roll over effect that
    should contain the "title"
    the rollover MC name is: thumbov_mc
    the dynamic text field is labeled: title
    And the links are not working either?
    Does anyone see the problem?
    Thank You So Much for you help in Advance

    If you think you can help just let me now and ill email you
    the link to where this menu is...i dont want to post it for
    everyone to see..thanks

  • Audio Action Scripts in Flash 8?

    I'm really hoping somebody can PLEASE help me with this
    problem. I have Captivate 2 and I am exporting the project to Flash
    8. When I do this, the audio is not exported. I have browsed this
    forum looking for answers, but haven't found a solution. I have
    verified that the handler action scripts are in their proper
    location. It just seems like when I export, it isn't respecting the
    audio action script, or something.
    Any ideas?
    I'll buy a round of beers to the person that finds a
    solution for me..:-)

    Hi wxcinc
    While the audio may be having issues converting cleanly to
    Flash, you do have the option of exporting the clips from
    Captivate. Then they would be available to use from Flash as
    separate entities.
    Just a thought... Rick

  • Projector's "Full Screen" viewing action script for Flash Cs5.5

    How do I set a Projector to "Full Screen" viewing on Flash Cs5.5
    Knowing that it already has action script.
    I have tried to add FSCommands on top, to no avail.

    stage.displayState="fullScreen";

  • Flash Professional Action Script help?

    I am try to create a website where people can view an online bible and search for within it for certain passages using a search box, but I don't know how to begin to make that happen, in flash professional. Please help.

    Whatever approach you take will depend heavily on the document(s) you have for the bible element of the design.  You somehow need to be able to seek within it and determine where matched elements can be found and how to extract the information you intend to present.
    I don't think your issue currently lies with how to do this in Flash as much as first coming up with a gameplan that identifies the players and how you can interact with and within them.

  • Document Class / Action Script Help

    Dear all,
    From a tutorial page, i manage to built this flash page with
    xml capabilities. but when i add more scene to the flash page, i
    have errors like this.
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at MyContent/init()
    at MyContent()
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at MyContent/onComplete()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()
    How do i edit the "MyContent.as" file so that i can add more
    scene to the flash.
    I understand that, once i put the "MyContent.as" in the
    document class, it will load immediately, is there any way to tell
    it to load only in scene 2 (which is where the xml is needed).
    Thanks. Any help will be very grateful.
    Attach is the actionscript

    other then defining the document class, can i "call up" the
    MyContent.as (external script) when needed?
    If this can be done, what must i do to add into the .fla file
    and the .as file..
    Sorry, i'm very new to AS3.
    Thanks!!!

  • Action script help: Quiz that uses an array needs to be changed.

    Hi,
    I have a quiz that was created by someone else, and now I (inexperienced with flash) need to make some edits. The quiz has 4 questions, and each answer the user clicks on will show a green ball, and then other text appears to let them know if they are right or not. Also, when they click the right answer "next" appears in the bottom right corner.
    Now I need to make the wrong answers red balls, and have the green ball only for the right answer. However it seems there is only one "green ball" and the code creates an array and that's all I can understand. I will need to make this changes to about 15 quiz questions, so hopefully the solution is something I can replicate easily on my own.
    Thanks!
    Here is the code:
    function doAnswer(n){
        //d or 4 is the correct answer.
        var bArray:Array = n.split("_");//split the button's name to array
        var butNum = bArray[1];//retrieve the button's number from the array
        //reset any answers that may have already been answered
        for (i=1;i<=4;i++){
            var currAns = "ans1_" + i;//current looped mc answer
            var currBut = "btn_" + i;
            if (this[currAns].actv == 1){
                this[currAns].play();
            if (this[currBut].actv == 1){
                this[currBut].play();
        this["ans1_" + butNum].play();
        if (butNum==4){
            next_mc._visible = 1;
        }else{
            next_mc._visible = 0;
    Flash CS5.5

    kglad,
    I'm not exactly sure what you mean. When the user clicks on the circle next to each answer, the colored ball fills the space. When they click on another answer, the ball from the previous answer disappears, so there is only one colored ball on the screen at a time. Does that help?

  • Loadmovie action script help

    Hey there, just putting together a website using flash.
    Everythings ok except, my website is one flash file, i've
    done a new document which is a page for my movie to
    play in. So i have jesl homepage.swf and now charles.swf
    On my homepage scene 3 theres a button you press
    using loadmovie script and it goes straight to the
    charles.swf
    and from charles.swf theres a go back button that goes
    straight back
    to my jesl homepage.swf
    using this from charles back to homepage
    on (release) {
    loadMovieNum("jesl homepage.swf", 0);
    Now all i would like to do is from charles.swf
    go back to my jesl homepage.swf like it does,
    but go to scene 3. Maybe its simple and im stupid
    but i cant figure it out. Cause scene 3 is where the
    info and buttons are about my movie and it would
    make sense to go back where you started from...
    So yeah it goes back fine to my scene 1 homepage
    but i want scene 3 guys...
    Any help would be greatful
    As im pulling my hair out..

    Hi there jestone and welcome to the on-line community
    I know this forum category says "FlashHelp", but note that
    both words "Flash" and "Help" are run together. This is a forum
    where people using FlashHelp output from the Adobe RoboHelp product
    ask questions. Most of the folks here are developers of the
    Microsoft Help technology. FlashHelp is simply one possible output
    from this product.
    I think you are probably looking for the Flash forum, so I'll
    give you a magic link to take you over there where you can post
    your question and be more likely to find an answer.
    Click
    here to visit the Flash forum
    Good luck! Rick

  • XML Driven Photo Gallery (Action Script Help)

    Hi,
    I need to make a XML Driven Photo slide in Flash CS5.
    It needs to have a Box that contains 5 Thumbnails(by XML) act as buttons.
    The  Box sits on top of the Main photo area and shrinks (or close out) when  user click its close button. And it opens out by clicking on a open  button.
    I'm sure it can be done by using timeline, Tweening or you name it..But what about the Thumbnails that run from the XML file?
    Can they disappear with the Box and retrieve when it opens? is it possible?
    If yes, what would be the best way to do that?
    Any comment would be greatly appreciated!
    Here is the ActionScript.
    import flash.net.URLRequest;
    import flash.net.URLLoader;
    import flash.events.Event;
    import fl.controls.Button;
    import flash.display.Shape;
    import flash.events.MouseEvent;
    import flash.display.MovieClip;
    import flash.display.Loader;
    import flash.text.TextField;
    import fl.transitions.*;
    import fl.transitions.easing.*;
    import flash.display.Shader;
    var hasloaded:Boolean = false;
    var firstLoaded:Boolean = false;
    var barWidth:int;
    var barHeight:int;
    var images;
    var imageCount:int;
    var thumbnailArray:Array = new Array();
    var bigImageArray:Array = new Array();
    var descriptionArray:Array = new Array();
    var xmlLoader:URLLoader = new URLLoader();
    var imageXML:XML = new XML();
    xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
    xmlLoader.load(new URLRequest("slideshow.xml"));
    function LoadXML(e:Event):void {
         imageXML = new XML(e.target.data);
         ParseImages(imageXML);
      Populates the arrays with the image values
      and the text for each picture.
    function ParseImages(imageInput:XML):void {
         var iconList:XMLList = imageInput.image.icon;
         var mainImageList:XMLList = imageInput.image.mainimage;
         var descriptionList:XMLList = imageInput.image.description;
         for (var i:int = 0; i < iconList.length(); i++) {
             var imageElement:XML = iconList[i];
             //trace(imageElement);
             thumbnailArray[i] = imageElement;
         for (var j:int = 0; j < mainImageList.length(); j++) {
             var mainimageElement:XML = mainImageList[j];
             //trace(mainimageElement);
             bigImageArray[j] = mainimageElement;
         for (var l:int = 0; l < descriptionList.length(); l++) {
             var descriptionElement:XML = descriptionList[l];
             //trace(descriptionElement);
             descriptionArray[l] = descriptionElement;
         loadImages();
    function loadImages():void{
         trace("inside of loadimages function.");
         trace(thumbnailArray.length);
         for(var i:int=0; i < thumbnailArray.length; i++){
             trace(thumbnailArray[i]);
             populateContainers(thumbnailArray[i], i);
             //populateContainers2();
             trace("Loaded " + thumbnailArray[i]);
    var loader:Loader;
    var xStart = -210;
    var ypos = -34;
    var currentPos = xStart;
    var incrementValue = 66;
      This takes in the name of the image file and
      displays it within the newly created movie clip
    function populateContainers(file:String, pos:int):void{   
         //create a movie clip to hold the image
         var mc:MovieClip = new MovieClip();
         mc.graphics.beginFill(0xFFFFFF);
         mc.graphics.drawRect(0, 0, 50, 51);
         mc.graphics.endFill();
         mc.buttonMode = true;
         mc.x = currentPos;
         mc.y = ypos;
         mc.name = "thumb_" + pos;
         mc.addEventListener(MouseEvent.CLICK, clickHandler); 
         loader = new Loader();
         //loader.mask = imagemask;
        var url:URLRequest = new URLRequest(file);
         loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadInitialImage);
         loader.load(url);
         //add the image to the movie clip
         mc.addChild(loader);
         this.imageBar.addChild(mc);
         //increment the currentPos
         currentPos += incrementValue;
    function clickHandler(e:MouseEvent):void{
         var str:String = e.currentTarget.name;
         var index:int = int(str.substr(6,1));
         if(hasloaded) {
             this.mainWindow.removeChild(loader);
         loader = new Loader();
         loader.load(new URLRequest(bigImageArray[index]));
         this.mainWindow.addChild(loader);
         TransitionManager.start(this.mainWindow,{type:Fade, direction:Transition.IN, duration:2, easing:Regular.easeOut});
         //setChildIndex(loader, 0);
         hasloaded = true;
         loadText(index);
    function loadText(index:int):void {
         Object(this).imageBar.txtdescription.text = descriptionArray[index];
    function loadInitialImage(event:Event):void {
         if(!firstLoaded) {
             loader = new Loader();
             loader.load(new URLRequest(bigImageArray[0]));
             this.mainWindow.addChild(loader);
             TransitionManager.start(this.mainWindow,{type:Fade, direction:Transition.IN, duration:2, easing:Regular.easeIn});
             //setChildIndex(loader, 0);
             hasloaded = true;
             loadText(0);
         firstLoaded = true;
    /*  This section defines the buttons that control the image bar */
    Object(this).imageBar.btnBarOpen.addEventListener(MouseEvent.MOUSE_UP, openImageBar);
    function openImageBar(event:MouseEvent):void {
         this.gotoAndPlay(1);

    Well Thats what i know but you might be able to use flash player 10 in your browser i think the file system works on it fine im not sure i mostly work on air glad i could help
    James

  • Newbie Action Script Help

    Hello List.
    This is my first try at Flash.
    I tried the drag and drop demo at
    http://monkeyflash.com/tutorials/flash-drag-and-drop/.
    It works well allowing me to drag an item and have it register when
    it is dropped on the correct target.
    I want to modify it so that I can drag an item to multiple
    locations... not just one.
    My desired application is the ability to drag pendents or
    charms onto a bracelet or chain and have them "snap" to the chain.
    With the above demo, I can see how 90% of it would work, but I
    cannot figure out how to have multiple targets named the same. The
    bulk of the code is attached.
    The line I believe needs to changed is this one:
    if (event.target.dropTarget != null &&
    event.target.dropTarget.parent == myTarget){
    I need this part :event.target.dropTarget.parent == myTarget
    to read something to the affect of:
    if item being dropped is over object A OR object B OR object
    C OR object D than ... rest of my code
    Can this be done?
    Any help is greatly appreciated.

    if drag1MC is one of your dragable movieclips and has
    acceptable drop-targets mc1, mc2,mc3:
    drag1MC.droptargetA = [mc1,mc2,mc3];
    function dropIt(event:MouseEvent):void {
    var mc:MovieClip = MovieClip(event.currentTarget);
    mc.stopDrag();
    var success:Boolean = false;
    for(var ind:int=0;ind<mc.droptargetA.length;ind++){
    if(mc.dropTarget!=null&&mc.dropTarget==mc.dropTargetA[ind]){
    success = true;
    mc.x = mc.dropTargetA[ind].x;
    mc.y = mc.dropTargetA[ind].y;
    break;
    if (success){
    reply_txt.text = "Good Job!";
    } else {
    reply_txt.text = "Try Again!";
    }

  • FlashGame, "sniper"-game, Action script help!

    Hello!
    I was trying to create a simple shooter game in Flash.
    And i want it to be very simple and not good looking if you
    now what i mean.
    Now to my problem.
    The game is all about to aim at a target and then fire/click
    and if you have hit the target, it should go to another frame. I
    want it to go to frame 5 after that you have hit the target.
    The sight is very simple, it´s a circle whit a cross in
    it. And it have a transparent background.
    The mouse is "hide" and the grafic (sight) show instead.
    BUT the moues is not "hide" in the midle of the sight. I want
    to decide where the mouse should be hide in the sight.
    I now that it can be hard to understand what i mean,
    so download the FLA file so that you have a better overview
    of my problem.
    http://rapidshare.com/files/90288167/SkjutTest.fla.html
    Please take time and help me solve my problem.
    Sorry for my eng. , i´m Swedish.
    Thanks!
    //SweFille

    you can't control where the hidden mouse is located. you can
    control where you sight is located.
    so, if you want the mouse to be at the lower left of the
    sight, place the sight movieclip at the _xmouse+whateverX,
    _ymouse-whateverY. though, i can't think of any reason you would
    want to do that unless you just want to aggrevate your users so
    they shut down your game sooner rather than later.

  • Need Action Script Help PLEEAASEE

    I have a project that and  is a prize wheel, here is my code for starting and stopping the wheel
    if (Key.isDown(Key.ENTER))
    speed=speed*.99;
    else if (Key.isDown(Key.RIGHT)){
        speed=5;
    else if (Key.isDown(Key.LEFT)){
        speed=0;
    this._visible=true;
    The right and left key functions work perfect but the enter key needs to be "held down" until the wheel slowly stops. I want to be able to just press the "Enter" key and the wheel will slowly (randomly)come to a halt. the problem code is in bold. any help would be great.

    Assuming you really mean you want to press and release the Enter key, what you need to do is have something else play the role of what the "if (Key.isDown(Key.ENTER))" line does for you in terms of repeatedly changing the speed value.  Something in the way of an onEnterFrame activity that gets intiated by the pressing of the Enter key, but just once... you need something to only allow it to intiate that enterFrame once...
    So somewhere outside that code you want to have a Boolean variable that is used when the Enter key is pressed which conditionally calls a function that initiates the enterframe activity and then sets that value to false to keep it from being called again.  That variable could be reset to true when the RIGHT key initiates a new go.  So pressing the Enter key sets that variable to true.  The code would follow along the lines of what I show below, but I cannot say it's polished stuff as shown... just the concept is attempted.  I don't know what other code you have involved in matters.
    var startSlowing = true;
    if (Key.isDown(Key.ENTER))
         if(startSlowing){
              slowItDown();
              startSlowing = false;
    else if (Key.isDown(Key.RIGHT)){
        speed=5;
        if(!startSlowing ){ // means it was restarted in mid-spin
              delete this.onEnterFrame;
          startSlowing = true;
    else if (Key.isDown(Key.LEFT)){
        speed=0;
        if(!startSlowing){
              delete this.onEnterFrame;
    function slowItDown(){
         this.onEnterFrame = function(){
              speed=speed*.99;
              if(speed < someLimit){
                   delete this.onEnterFrame;

  • Action Script Help

    Hi to all,
    This is vertical xml gallery code, where the mouse will move
    up, then the scoller will move up and vice versa. now i want the
    reverse . if it move up , then the scoller come down and if it move
    down , then the scoller move up.
    Can anyone please help me.
    Thanks
    Krishna
    quote:
    this.onEnterFrame = function()
    mask_y = _root.main.verti.mask._y;
    mask_h = _root.main.verti.mask._height;
    mask_middle = (mask_y + mask_h) / 2; // take middle of mask
    as reference
    roller_y = _root.main.verti.roller._y;
    roller_h = _root.main.verti.roller._height;
    ymouse = _root.main.verti.mask._ymouse;
    // if mous out of range
    if (ymouse < mask_y || ymouse> mask_y + mask_h)
    speed = 0;
    else
    speed = (ymouse - mask_middle)/ 10;
    // calculate speed -> the closer to middle-> slower,
    closer to edges-> faster
    // if roller bottom reaches mask bottom and scroll up, stop
    if ((roller_y+roller_h)<(mask_y+mask_h) && speed
    < 0)
    speed = 0;
    // if roller top reaches mask top and scroll down, stop
    if (roller_y > mask_y && speed > 0)
    speed = 0;
    _root.main.verti.roller._y += speed;
    stop();

    try:

  • Action Script Help Please

    I am trying to figure out the proper verbage for this. If I
    want to have a button gotoAndPlay "home" but then immediately
    after, without stopping, gotoAndPlay something else, What is the
    code for that?
    I.E.:
    on (press) {
    gotoAndPlay ("home");
    [what do I put in next to make it go play something else
    without pausing?]
    Text
    Text

    You need to see that task with different eyes, as soon as the
    script reaches the gotoandplay line, the playhead will jump
    instantly to that location and you need to write the next jump on
    that home frame.
    Why don't you rather set a variable saying where it should go
    after home like:
    on(press){
    gotoAndPlay("home");
    var nextGoTo = xxx;
    and on your home frame you have an case statement runnning
    checking which variable you activated so it will jump directly to
    it.
    If you don't undestand what I mean with it, you can send me
    the fla file and I will show you how to create it.

Maybe you are looking for

  • Oracle BI Publisher Report from OEM12c data is not getting refreshed...

    Hello, We've integrated BI Publisher with EM12c. I've developed a report which checks a given database extents information (initial, next, maxextents) at tablespace level. The dataset is chosen as EM repository. The report runs absolutely fine until

  • ME31K, ME32K, OUn & OPU

    Hi all, I'm looking fow where the OUN & OPU fields are being populated from when entering or changing a contract. We are creating/adding to contracts (me31k, me32k) and these units are defaulting from somewhere and I just can't find where. We used to

  • SNOTE pdf Attachment

    HI Experts, Can anyone send me the attachment present in the website,as i am unable to open this to [email protected] http://www.sappoint.com/basis/snote.pdf. Thanks in advance.

  • Problems with viewing employees table in database

    Can any help me to be able to view all the tables in database: Employees, countries and so on? I think it is due inability to login as hr user. Thanks, Peter

  • How to print jTable with custom header and footer....

    Hello all, I'm trying to print a jTable with custom header and footer.But jTable1.print(PrintMode,headerFormat,footerFormat,showPrintDialog,attr,interactive) does not allow multi line header and footer. I read in a chat that we can make custom header