Go Back   kirupaForum > Flash > Flash CS3

Reply
 
Thread Tools Display Modes
Old 11-19-2009, 02:41 PM   #1
Solidus
you're not your khakis
 
Solidus's Avatar
Dynamic Buttons pulled from a directory

Hey guys,
I have a directory of PDF's that I am loading the names of dynamically using PHP:

My PHP file looks like this:
Code:
<?php

$dir = getcwd();
$dh  = opendir($dir);
while (($filename = readdir($dh)) == true) {
    $files[] = $filename;
}

echo "&count=" . count($files);
for($i=0; $i<count($files); $i++) {
    echo "&echo" . $i. "=" . $files[$i];
}

?>
And my Actionscript looks like this:
Code:
var LV:LoadVars = new LoadVars();
LV.onLoad = function() {
    for (i=0; i<LV.count; i++) {
        _root.attachMovie("box", "box"+i+"_mc", i, {_x:20, _y:30*i});
        _root["box"+i+"_mc"]._txt.text = LV["echo"+i];
        
    }
};
LV.sendAndLoad("catalog/readDir.php", LV, "POST");
Now the code works perfect and it displays the name of all the pdf's but I want to somehow make a button on top of each displayed pdf that makes it clickable.
The code is already storing the name of the PDF's so it should be pretty easy to do a
getURL("pdfname","blank") or whatever I just don't know where to start.

Here is the SWF output: https://ssl.perfora.net/s246612274.o...t/getFiles.swf
Solidus is offline   Reply With Quote

Sponsored Links (Guests Only) - Register | Need Help?
 

Old 11-19-2009, 03:10 PM   #2
Solidus
you're not your khakis
 
Solidus's Avatar
Damnit. I thought I had a brilliant idea and that this would work:

Code:
var LV:LoadVars = new LoadVars();
LV.onLoad = function() {
    for (i=0; i<LV.count; i++) {
        _root.attachMovie("box", "box"+i+"_mc", i, {_x:20, _y:30*i});
        _root["box"+i+"_mc"]._txt.text = LV["echo"+i];
        _root.attachMovie("buttonSymbol", "btn", 1);
        _root.btn.on (press) {
            getURL(LV,"_blank");

}

}

        
    }
};
LV.sendAndLoad("catalog/readDir.php", LV, "POST");
But alas my terrible brain has betrayed me again.
Solidus is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:50 PM.

SUPPORTERS:

kirupa.com's fast and reliable hosting provided by Media Temple. flash components
Creative web apps. Make your own free flash banners and photo slideshows.
Check out the great, high-quality flash extensions. Buy or sell stock flash, video, audio and fonts for as little as 50 cents at FlashDen.

Flash Transition Effects

Flash Effect Tutorials

Digicrafts Components
Flash effects. Art without coding. Upload, publish, deliver. Secure hosting for your professional or academic video, presentations & more. Screencast.com
Streamsolutions Content Delivery Networks Flipping Book - page flip flash component.
Flash-Gallery.com - Get your flash photo gallery (flash component or swf gallery Learn how to advertise on kirupa.com
 

cdn
content delivery network (cdn)

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. Copyright 2010 - kirupa.com Copyright 2010 - kirupa.com