dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Flash gurus, you are my only hope.

  1. #1
    Junior Member
    Join Date
    Mar 2003
    Posts
    16

    Flash gurus, you are my only hope.

    Ok I am making a website for my friends band. Going for an art-sy kind of look. The main thing I'm going for is to make it editable from outside the flash movie and using anything but flash to add and update the site.
    First glance at the site, www.genericsam.com, the flower bulbs are navigation and the genericsam link takes you back. On the lyrics page I would like to have sort of anchors that drop down the page when you click on the link, but I used a flash exchange scroll bar, so Im guessing html wont work exactly the same, and it didnt. Any suggestions on how to do this would be greatly appreciated, Ive taken a year of C++ so im not ignorant to the code you will send me, just dont know all the flash functions yet. Dont mind going about it a completely different way either, just whatever you flash dudes think. Appreciate it.
    -Acid

  2. #2
    Member
    Join Date
    Oct 2002
    Location
    London
    Posts
    55
    You can use anchor links in a flash text box by using the 'asfunction'. This lets you call an Actionscript function when the text is clicked.

    As for dynamic flash, I've been working on a Flash image gallery. It displays 10 thumbnails per page. It allows a slightly larger preview within Flash and a another method to view the image full-size.
    I think I just finished it (for real this time ).
    I'll try to explain:

    The image directories are organised into categories. Each category contains 1 or more 'Artist' sub-directories. Each sub-directory contains some images.
    The SWF loads all this info at runtime including how many images in each artist category, the paths for the different images etc. This is all loaded in by calling a cgi/perl script through the LoadVars()object.
    All I have to do to update the movie is upload new images (maintaining the file structure).

    It seems to work instantaneously but I expect there's a better way to do it in PHP or something but I don't know that yet :/

    You can see what I mean here... Flash Gallery.

    I'll post the .fla and cgi script if ya like...
    Last edited by b3n; 04-01-2003 at 05:30 PM.

  3. #3
    Junior Member
    Join Date
    Mar 2003
    Posts
    16

    Wow

    Very impressive, yes ive seen vars loaded thru a php file and seems simple enough, I would love to see the .fla for that document if you dont mind, my email is acidflame@triad.rr.com if you dont want to post it pub. I think a dropdown box would work beautifully ill ask him what he thinks, as long as the dropdown box can be edited from that php/perl file you speak of then it shouldnt matter. Although I would like to get the anchors working as he wishes as well. Thanks for the help brah.

    And oh yes do you know a good tut for making a scrollable text box that reads from outside source. Like the one I have only mine is an exchange component, I would like to make it myself even if the code is hefty.
    -Acid
    Last edited by skorchedflame; 04-02-2003 at 07:33 AM.

  4. #4
    Member
    Join Date
    Oct 2002
    Location
    London
    Posts
    55
    Thanks! Yeah I'll email the .fla

    It gets a little complicated but I've included a lot of comments and I had customisation in mind right from the start. It's easy to change all of the component colours and font-formatting etc in the first frame of the movie.

    I'll make the whole thing a component one day... it 's easy to change the number of images per page (though I would have to set up vars for each image width/height first).

    I'll include the CGI script (though you could easily re-write it in C++ if ya want).
    You'll have to change the path to the main Image directory. And I guess you'll have to change the path to te cgi script in the fla.

    You have to be connected to test the FLA and you may want to re-create the Image folders on you local system, if u get what I mean.

    Anyway I'll email you the files later... I'm at uni at the moment...

    RE: scrolling external text - You should be able to use a Scroll Pane Component. Or I think you can drag a Scroll Bar Component onto any Text-box.

  5. #5
    Junior Member
    Join Date
    Mar 2003
    Posts
    16
    Appreciate it. Yes I see that you can drag the scroll bar onto the side of the dynamic text box, but I just dont know how to set up a var to load the text. Im sure its easy, just havent taken the time to figure it out. And what do you mean you can call a function from html, how would flash get the information? Excuse my ignorance.
    -Acid

  6. #6
    Member
    Join Date
    Oct 2002
    Location
    London
    Posts
    55
    I'll assume you have given the text-box a variable name. If you are loading vars from a file, it must be url-encoded (no white spaces etc):

    eg:
    Code:
    textBoxVar="Here is your text"&success=1&
    It can contain HTML, which you would need enabled for the text-box if you want to use named Anchor style links.
    Sometimes Flash tries to display the text before it's loaded, hence the 'success' variable.
    Note you have to terminate each variable with an ampersand(&).
    I think it might allow the white spaces in Strings - but if not I have a handy translator html page that I'll post/email.

    The text would be loaded into Flash via:

    Code:
    loadVariables("textFile.txt");
    if (success==1)
    {
     play();
    }
    Many people load the variables into a hidden movieClip, thus allowing the use of onClipEvent(data) instead of the 'success' variable.


    RE: Text Anchors

    FROM MACROMEDIA TECH-NOTE 15639
    Flash 5's undocumented asfunction command allows an HREF link in an HTML-enabled text field, or a text field linked using the URL field in the Character panel, to call a user-defined function. Typically, URL text links in Flash are limited to calling other HTML pages, similar to the getURL action. Using asfunction, a text link can call a function that can then perform a variety of ActionScript statements.
    The 'asfunction' IS documented in Flash MX, check the Actionscript Dictionary - I think it even outlines how to do anchor tags.

  7. #7
    Junior Member
    Join Date
    Mar 2003
    Posts
    16

    thx

    Very powerful addition to my knowledge of dynamic links and such. Yet, in the actionscript dictionary it did outline the use of a function for a link and displaying something as a result, yet i dont see the anchors, I understand that I could do it someway with this function, yet I was hoping for an function like moveTo(anchor); or something to that effect, still unsure on how to go about doing that.
    Thx in advance.
    -Acid-

  8. #8
    Member
    Join Date
    Oct 2002
    Location
    London
    Posts
    55
    Hi,

    I managed to come up with this... maybe a solution for named anchors in dynamic text-boxes!

    I sent the .fla and .txt file to your email so you can try it out. Just thought I 'd put it up here as well in case anyone else wanted to know about anchors.

    Code:
    function anchor(jumpTo)
    {
     // jumpTo -> How many lines below the current line...
     // eg: anchor(2) -> THIS WOULD JUMP DOWN 2 LINES
    	
     theTextBox.scroll = theTextBox.bottomScroll-jumpTo;
    }
    The function, 'anchor', would be called from dynamic text using code like this:
    Code:
    <xmp><a href='asfunction:anchor,2'>JUMP LINK</a></xmp>
    You can see that you have to know how many lines your text takes up and at what line number you want specific jump-targets. This is the best method I could get to work. But I'm sure there's a better way... try experimenting with the properties below.

    FOR YOUR REFERENCE::

    myTextField.scroll -> The Top-Line in the text-field that is currently visible

    myTextField.bottomScroll -> The Bottom-Line in the text-field that is currently visible

    myTextField.maxscroll -> The highest possible value of 'scroll'

    Only 'scroll' can be set. The others are read-only.
    Last edited by b3n; 04-07-2003 at 06:11 AM.

  9. #9
    Junior Member
    Join Date
    Sep 2001
    Posts
    25
    hi guys,

    you could make a girl very happy if you would send me the fla file of the slideshow.

    cyberlisa68@hotmail.com

    greetz,

    lisa
    Attached Images Attached Images

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center